• FEATURED

View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# converting 3d vector of forces to distance

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

### #1jaco161  Members

Posted 30 August 2012 - 07:42 PM

I'm wondering if anyone can help me finding the distance traveled by a planet due to gravity. I can find the force but I can't figure out how to convert from a force in direction a(a^2 = x^2 + y^2 + z^2) where x y and z are forces to x y and z as distances...Can anyone help me?

### #2rnlf  Members

Posted 31 August 2012 - 12:47 AM

If you have all forces acting on the planet (gravitiy from all other celestial bodies close enough to make a difference), then dividing the sum of the forces by the planets mass will give you the acceleration of the planet. Integrate that over time and you get the planets velocity, integrate that over time and you get its position. (But make sure your planet has an initial velocity with a component perpendicular to the line from the planet to the sun, or else your planet will fall directly into the sun).

If you care only about the sun's gravitational pull on the planet and want to ignore other celestial bodies, you may also use Kepler's laws of planetary motion (http://en.wikipedia.org/wiki/Kepler%27s_laws_of_planetary_motion#Computing_position_as_a_function_of_time) to analytically calculate the planets position at a given time.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.