1
$\begingroup$

I've built a model of the Solar System by calculating Keplerian orbital elements. The model takes a time $t$ which is incremented with each frame of the simulation. I then calculate the new positions of each body. $t$ is really the time since perihelion for each orbit.

This means that at the beginning of the simulation each object starts at its perihelion (since $t=0$). So, now I'd like to place a new body (a comet, for example) with a position $P$ and velocity $V$. From $P$ and $V$, I calculate the orbital elements such as eccentricity $e$, semi-major axis $M$, etc.

Now, I can calculate the next position of this new body (since $t$ has been incremented) using these orbital elements. However, since $t$ is the time since this new orbits perihelion, the calculated position will not be the next incremental position. One solution to this could be that I calculate the time ($t\text'$) at which this new orbit would position the body at $P$ and increment $t\text'$. This means that instead of having a global $t$, I have a $t$ for each body which is incremented at the same rate.

Does this sound sensible?

$\endgroup$
1
$\begingroup$

You can do both. For each object, store the time of perihelion. You have a global time for observation. A subtraction gets the time since perihelion.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.