Putting Together the Mathematics So Far
We’ve established the relationship:
We also saw earlier that eccentricity can be defined as:
This gives us enough to interrelate the four quantities:
- a — semi-major axis
- b — semi-minor axis
- c — focal distance
- e — eccentricity
and, given any two, calculate the other two.
In particular, we can square the second equation, rearrange it to get c2 by itself and then substitute into the first equation to get:
This can be rearranged to get eccentricity as a function of the ratio of semi-minor axis to semi-major axis:
or the semi-minor axis as a function of the semi-major axis and the eccentricity:
These equations are used at various points in the code behind all these visualisations.
It is common for the semi-major axis and eccentricity to be given for an orbital body and the other two values calculated from them.