Skip to content
se5a edited this page Dec 7, 2021 · 1 revision

Elliptical Orbits:

These are handled using Keplerian Elements. Position is calculated via Newton's Method. This allows us to calculate the position at any datetime meaning we can leap forward in time for these objects by hours, days, months, years even decades into the future, or even the past, and calculation cost is irrelevant with regard to how far into the future we're calculating for.

The math can for the most part handle 3d orbits, however we're only using 2d orbits in the game, so in most cases inclination will be 0, excepting in retrograde orbits where inclination is 3.141593 radians (180 degrees).

Reference direction is "east" i.e. screen right. (This is due to most math functions, i.e. Math.Atan2 expecting this.)

Hyperbolic Orbits:

Currently we're handling these via a more normal calculate the position each second, and iterate that forward till we get to the datetime we're looking at. this is less than ideal, and if anyone knows how to calculate hyperbolic and parabolic orbits like we do with elliptical ones, it could speed up processing quite considerably.

Clone this wiki locally