[Math] Calculating point on circle after time

circlestrigonometry

I have a question that seems very similar to calculating-point-around-circumference-of-circle-given-distance-travelled and calculating-point-on-a-circle-given-an-offset, but I don't believe they are quite the same. I'm not very good at math :/

I have planets orbiting a center planet (sun). This is in 3d-space, but only 2 are used so this is safe. The things I know are:

  1. The (x,y) position of the sun (Sx, Sy).
  2. The (x,y) position of planet A (Ax, Ay).
  3. The radius (or distance) from sun to A (r).
  4. The speed in which A is traveling along the orbit in Radians/sec (s).
  5. The time that has elapsed since A last moved along the orbit (t).

What I'm looking for is some kind of formula to calculate the next (x,y) coordinate of planet A, based on it's current position, speed, and time elapsed.

Please explain the math behind this.. I know a little trig and I'm interested in learning more, especially since I'm tackling a very realistic space-simulation.

Best Answer

If the orbit is circular the calculation is simple: $A_x=S_x+r \cos (ts), A_y=S_y+r \sin (ts)$. Without the force law you don't know if the orbit is circular, which will happen if the speed is just right for the distance. Presumably you are using Newton's gravitational law, in which case you need the mass of the sun to plug in.

If the orbit is not circular, you can either solve Kepler's laws or integrate the differential equation. The differential equation lets you apply other forces that might change the orbit as you go along, like thrusting from a spaceship or gravity effects of other planets. A popular approach for the differential equation is a Runge-Kutta method, where $y$ in the Wikipedia page becomes a vector with one component for each space direction of location and another for each component of velocity.