Coding Orbital Mechanics
I forget what inspired me, probably discussions about propellant depots, but after an hour of two playing around in the great spaceflight simulator Orbiter I decided to give the old orbital mechanics another go. I've written dynamic physics simulators before which have really nice accuracy and can handle the big numbers required for orbital simulations, including three body problems, but I never managed to tackle the classical orbital mechanics - too much Greek terminology I guess - until today. I set myself a somewhat difficult task: Given a position vector r and a velocity vector v , somewhere above a reference (say, a planetary body) calculate all the required classical orbital elements: a - semi-major axis e - eccentricity i - inclination l - longitude of the ascending node w - argument of periapsis t - true anomaly There's others, but they can be derived from these. You'll also note I haven't used any Greek letters that my keyboard doesn...