Example #1
0
 public static double semimajorAxis(Orbit orbit)
 {
     throw new System.NotImplementedException();
 }
Example #2
0
 public static double timeFromPeriapsis(Orbit orbit)
 {
     throw new System.NotImplementedException();
 }
Example #3
0
        public static double timeFromPeriapsis(Orbit orbit)
        {
            double ea = eccentricAnomaly(orbit);

            return Math.Pow(orbit.semimajorAxis, 1.5) / orbit.mainBody.gravParameter.sqrt() * (ea - orbit.eccentricity * Math.Sin(ea));
        }
Example #4
0
 private static double eccentricAnomaly(Orbit orbit)
 {
     return 2 * Math.Atan(((1 - orbit.eccentricity) / (1 + orbit.eccentricity)).sqrt() * Math.Tan(orbit.trueAnomaly / 2));
 }
Example #5
0
 public static double semimajorAxis(Orbit orbit)
 {
     return orbit.parameter / (1 - orbit.eccentricity.sqr());
 }