   [Orbital] Gravity
  Hey all! :)I am wondering how to calculate gravity for a planet & have objects act accordingly. Basically, this is what I want to do:Have a few planets, for now lets just leave it at one. This planet has a mass of 20 (goes from 0-100). Then I have a asteroid. This asteroid should now be attracted by the planets gravity. However, this should be calculated in to a XVelocity and a YVelocity. ANd that part I am unsure of.Hope someone can help me out here, and if my post is not detailed/confusing than I will draw some pics to clarify.Thanks in advance! :)   
  BEFORE editTo calculate into a xvelocity and yvelocity, you would need to find the gravitational force that planet exerts, then find out the acceleration, and then apply the acceleration to the asteroid. The asteroid's velocity would then change.AFTER editTo calculate into a xvelocity and yvelocity, you would need to find the gravitational force that planet exerts, then find out the x and y components of the acceleration, then apply the acceleration components to the current velocity components.   ;  The problem here is, I do not know how to do these things. :-/   ;  http://en.wikipedia.org/wiki/Newtonian_Physics   ;  To find the force exerted on the asteroid use Newton's law of universal gravitation.To find the acceleration of the asteroid towards the planet use Newton's second law of motion.To find the new velocity (given the old velocity and the amount of time that has passed since the last frame) use the first SUVAT equation.   ;  Hi there Pseudobot,Playing around with gravity simulation is really fun, and I've done so for a couple of years :-) To help you along, here's a very small, well commented code sample demonstrating how to simulate gravitationally interacting objects on a computer. It's written in a language called freebasic which you might not know, but it's easily readable, and once you understand the principles behind it, you should be able to port it to whatever language you use.http://www.jernmager.dk/stuff/freebasic/gravity_02.zipgood luck with it!Cheers,Mike   