Skip to content

Commit

Permalink
Remove TimeOfTrueAnomaly since stock game has the same one
Browse files Browse the repository at this point in the history
  • Loading branch information
sarbian committed Mar 28, 2023
1 parent 584aad1 commit 8a06df1
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions MechJeb2/OrbitExtensions.cs
Expand Up @@ -183,7 +183,7 @@ public static double Separation(this Orbit a, Orbit b, double UT)
public static double NextClosestApproachTime(this Orbit a, Orbit b, double UT)
{
double closestApproachTime = UT;
double closestApproachDistance = Double.MaxValue;
double closestApproachDistance = double.MaxValue;
double minTime = UT;
double interval = a.period;
if (a.eccentricity > 1)
Expand Down Expand Up @@ -458,14 +458,7 @@ public static double GetMeanAnomalyAtTrueAnomaly(this Orbit o, double trueAnomal
{
return o.GetMeanAnomalyAtEccentricAnomaly(o.GetEccentricAnomalyAtTrueAnomaly(trueAnomaly));
}

//NOTE: this function can throw an ArgumentException, if o is a hyperbolic orbit with an eccentricity
//large enough that it never attains the given true anomaly
public static double TimeOfTrueAnomaly(this Orbit o, double trueAnomaly, double UT)
{
return o.UTAtMeanAnomaly(o.GetMeanAnomalyAtEccentricAnomaly(o.GetEccentricAnomalyAtTrueAnomaly(trueAnomaly)), UT);
}


//Returns the next time at which a will cross its ascending node with b.
//For elliptical orbits this is a time between UT and UT + a.period.
//For hyperbolic orbits this can be any time, including a time in the past if
Expand Down

0 comments on commit 8a06df1

Please sign in to comment.