Question: Do this Add an accelerate Body function with a single parameter : The body number . To calculate the total force on a body ,

Do this Add an accelerate Body function with a single parameter : The body number . To calculate the total force on a body , you must add up all the separate forces on a body by all bodies other than itself .* Start a for loop that does this :" For each body number in the range NBodies :" If that body number is not equal to the body number parameter ! Calculate the force on the badly by calling calculateForce . That function returns two values . You can capture them in variables like* this : c , d = calculate Force ( a , b) but don't use those variable names literally . That's just an example of how to do it . Calculate the * & Vaccelerations . Create new variables for this . The*x acceleration is the force in the * direction divided by the mass of the body ( the body is the one specified by the body number parameter ). DO the same for the " acceleration . Add the * & y accelerations to the x and * velocities of the body ( You know where to find those , right ?" The body is the one specified by the body number parameter . And don't just add the accelerations to the velocities , you must add and then store the sums back into the respective lists
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
