This craft contains a Flight Program that has custom expressions for converting position/velocity vectors to orbital elements and vice versa, as well as converting between True, Mean, and Eccentric anomalies.
This craft flight program doesn't require any mods, however, be warned, I haven't tested the hyperbolic orbit support since I added the hyperbolic trig function implementation.
20 Comments
 Log in to leave a comment


4,796 TweedleAerospace
@Vedhaspace it defines the angular position of an orbit along with true anomaly and eccentric anomaly


4,796 TweedleAerospace
@sflanker does the m in the true anomaly stand for the mean anomaly?

4,796 TweedleAerospace
@sflanker yep. At first I accidentally told it to rotate 180 radians which was a horrible mistake. Then I converted to degrees and inputed 3.142. It ended up getting the same result. I will try 90 and see what happens.

Mod sflanker
@Tweedle_Aerospace I'm not sure what the result would be, it should probably be the same as the original value, but I haven't tested it.

4,796 TweedleAerospace
@sflanker one last one: can I rotate a point on the surface around (0, 0, 0) and it succeed.

4,796 TweedleAerospace
@sflanker it seems that worked. Although now I am trying to calculate the hohmann transfer. It seems when I use the vis viva equation it comes back with either NaN or a rapidly shrinking number that turns into NaN.

Mod sflanker
@Tweedle_Aerospace Certainly, if you know eccentricity and periapsis you can find SMA by simply rearranging the terms:
a = P / (1  e)

4,796 TweedleAerospace
@sflanker could I “reverse engineer” the periapsis equation to find the semimajor axis?

4,796 TweedleAerospace
@sflanker thanks! I knew how to calculate them. I am going to use it for a custom career mode I have been working for a while. I started it out as a little building that just displayed the missions. But MFD’s have made it possible to add points and upgrades. (Trust me this wasn’t taken from Gonzonya. I am not going to release it because people will say it is though.)


Mod sflanker
@Tweedle_Aerospace Yes, the periapse distance, or perigee, is equal to the semimajor axis times one minus eccentricity
P = a * (1  e)
, and the apoapse distance, or apogee, is equal the semimajor axis times one plus eccentricity. This holds true for both elliptical and hyperbolic orbits (for hyperbolic orbits(1  e)
becomes negative becausee > 1
, but semimajor axis is also negative for hyperbolic orbits). Parabolic orbits are special snowflake, but I just pretend they don't exist. You can use the custom expressions on this craft to get semimajor axis and eccentricity from velocity and position. 
4,796 TweedleAerospace
Is there any way to calculate a crafts perigee from just altitude, velocity, and position?





Theres so much dude how does all of this work pls explain