Apoapsis/Periapsis Vectors

Chetic

New member
Joined
Sep 27, 2010
Messages
1
Reaction score
0
Points
0
I'm making a 2d space game and want to calculate orbits instead of running the simulation ahead. I've looked around a lot, mostly on Wikipedia, and can't really find a formula that can be manipulated to give what I need. I've had pretty much no physics education so forgive me if this is a trivial question.

How do you calculate vectors for apoapsis/periapsis?

Maybe there is a better way to calculate the ellipse? Though I will need these vectors later anyway.
 
Wikipedia's Orbital Mechanics page shows an equation for r = p divided by (more) in the "Formulae for free orbits" section.

This gives the distance from the center of the central body to the orbit (this is r, the orbital radius) as a function of some constants and the cosine of an angle. That angle is the angle between the periapsis point and the current point on the orbit. This is enough to draw your 2D orbit, after you assume some orientation for the orbit (pick the direction of periapsis.) .

Calculating the angle as a function of time is much harder. (It's easy to draw an orbit, but hard to show a spacecraft circling the planet accurately along that orbit. As you get farther from the planet out toward the apoapsis, the vehicle slows down. This describes how that happens.) There is no simple equation for this result: it has to be searched for (iterated for). (Kepler's equation on that page, E = ... ) Explaining how to do that properly would take several chapters from a couple of different books.
 
Back
Top