Question: Python Task: Implement the position _ howe _ truss _ vertices function in the code cell below. # This function determines the x , y

Python Task: Implement the position_howe_truss_vertices function in the code cell below. # This function determines the x,y coordinates of each of the vertices in the top row and bottom row of a Howe Truss. # Parameters: # - horizontal_span_length is the total distance that the bridge spans (from the leftmost bottom vertice to the rightmost bottom vertex) # - number_of_segments is the integer number of segments across the bottom of the bridge. # Return values: # - a tuple containing two lists of vertices for the top and bottom rows. def position_howe_truss_vertices(horizontal_span_length, number_of_segments) : # do not change this line in any way - the function name and parameters must remain exactly as specified here pass # ToDo: replace this line by your code
Tests: result = position_howe_truss_vertices(1,1) code_analyser.assert_equal(result,([],[(0,0),(1.0,0)]),'e1')
result = position_howe_truss_vertices(2.1,1) code_analyser.assert_equal(result,([],[(0,0),(2.1,0)]),'e2')
result = position_howe_truss_vertices(1,2) code_analyser.assert_equal(result,([(0.5,0.5)],[(0,0),(0.5,0),(1.0,0)]),'e3')
result = position_howe_truss_vertices(5,5) code_analyser.assert_equal(result,([(1.0,1.0),(2.0,1.0),(3.0,1.0),(4.0,1.0)],[(0,0),(1.0,0),(2.0,0),(3.0,0),(4.0,0),(5.0,0)]),'e4')
result = position_howe_truss_vertices(1.5,6) code_analyser.assert_equal(result,([(0.25,0.25),(0.5,0.25),(0.75,0.25),(1.0,0.25),(1.25,0.25)],[(0,0),(0.25,0),(0.5,0),(0.75,0),(1.0,0),(1.25,0),(1.5,0)]),'e5')
result = position_howe_truss_vertices(3.14,8) code_analyser.assert_equal(result,([(0.3925,0.3925),(0.785,0.3925),(1.1775,0.3925),(1.57,0.3925),(1.9625,0.3925),(2.355,0.3925),(2.7475,0.3925)],[(0,0),(0.3925,0),(0.785,0),(1.1775,0),(1.57,0),(1.9625,0),(2.355,0),(2.7475,0),(3.14,0)]),'e6')
Python Task: Implement the position _ howe _

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!