Question: FreeBodyObjects.py 1Recall in Coding Problem 4.4.4 (and before that, in coding 2 Problem 4.3.9) you built a program for finding the net 3 force (magnitude

 FreeBodyObjects.py 1Recall in Coding Problem 4.4.4 (and before that, in coding
2 Problem 4.3.9) you built a program for finding the net 3

FreeBodyObjects.py 1Recall in Coding Problem 4.4.4 (and before that, in coding 2 Problem 4.3.9) you built a program for finding the net 3 force (magnitude and angle) on an object from several 4'#individual forces. 6|#In the next two exercises , we're going to convert that 7: #system into one that uses objects. 9|#70 start, create a class called Force. The constructor for 10 Force should have two required arguments: magnitude and 11 fangle. These should be saved to two attributes called 12| #'magnitude' and 'angle'. You should assume angle is 131 #initially in degrees , from-180 to 180. 15 #Then, add three methods to Force: 17 #-get-horizontal should return the horizontal component 18 of the force, according to the formula: 19 # horizontal-magnitude * cos (angle). 20#-get vertical should return the ve rtical component of 21 the force, according to the formula 22vertical magnitude sin(angle). 23 #-get-angle should return the angle of the force, but 24 should have a keyword parameter called use-degrees. 25 # use-degrees should default to True. If use, degrees 26- is true, itshould return the angle in degrees, if it 27 is false, it should return the angle in radians. 29 |NT: Don't overcomplicate this. All we want here is 30 a class called Force with four methodsnit 31 #get horizontal, get-vertical, and get, angle. Note that 32 these are not true.getters", even though they have "get- 33 in their names: all three will have some reasonin 34 #beyond just returning a single value. 36 1NT 2: angle will initially be passed into the 37 #constructor in degrees. You may store it in ather 38 #degrees or radians. Each approach has different benefits, 39 #but, make sure to keep t ac 40 when it's in degrees: when it's in angles and

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 Databases Questions!