I looked into the Orbiter manual once again. We have
semi-major axis = - G * major body mass / (2 * orbit specific energy),
eccentricity = sqrt (1 + 2 * orbit specific energy * h^2 / (G^2 * major body mass^2))
Hence
semi-latus rectum = semi-major axis * (1 - eccentricity^2)
= - G * major body...
Oh, now I saw the formula
But to compute the right hand side, I only know the formula
which also seems to be undefined in the case of a parabola. So I still have no idea what to do in the case of a parabola.
Thanks for your replies! So if I have a hyperbola, I can also use the formula
and the semi-major axis is then negative, whereas it is positive in the case of an ellipse, right? And that yields the same formula for the semi-latus rectum, i.e.
no matter if we have an ellipse or a hyperbola.
But...
The semi-latus rectum is necessary for the formula
However, if we refer to Wikipedia, we need to know the semi-major axis to calculate the semi-latus rectum. But the semi-major axis is only defined for circles and ellipses, if I am not getting it wrong.
So assume I am in a parabolic or...
Ok, so no simple solution? :( Only the energy-mass-ratio of an orbit is certainly not enough since we can have very different orbits with the same energy. But yes, maybe combining it with angular momentum will yield something meaningful, so thank you for that idea!
Actually I want to land on...
If the planes of the two orbits are different and if the orbits intersect only at the nearer node, then it might be cheaper to do the plane alignment at the further node and then to match the orbits at the next intersection. So even if we are in the one-spherical-body model and if there is an...
The question is to be understood in the idealized model where I have only one point mass and a vessel with neglectable mass in orbit, Newton mechanics. Thanks for your help!
Hi, thank you so far. @n72.75, I would like to obtain the locations and velocities for all bodies, for different times. The names are only necessary to map them correctly.
Now I have seen that pGBody is NULL only for Vesta, the Neptune moons and one of the Uranus moons.
I want to get ephemeris data of all bodies. So I do the following:
unsigned int nGBodies = oapiGetGbodyCount();
for (unsigned int iGBody = 0; iGBody < nGBodies; iGBody++) {
OBJHANDLE hGBody = oapiGetGbodyByIndex (iGBody);
CELBODY *pGBody = oapiGetCelbodyInterface (hGBody);
...
}...