Exemplo n.º 1
0
 private void UpdateDynamicVariables(double newTime)
 {
     if (this.lastCalculationTime != newTime)
     {
         this.lastCalculationTime = newTime;
         double eccentricAnomaly = Kepler.GetEccentricAnomaly((newTime - this.periapsisPassageTime) * this.meanMotion, this.eccentricity);
         if (double.IsNaN(eccentricAnomaly))
         {
             return;
         }
         this.eccentricAnomnalyOut = eccentricAnomaly;
         this.trueAnomalyOut       = Kepler.GetTrueAnomaly(this.eccentricAnomnalyOut, this.eccentricity);
         double radius = Kepler.GetRadius(this.semiLatusRectum, this.eccentricity, this.trueAnomalyOut);
         this.posOut = Kepler.GetPosition(radius, this.trueAnomalyOut, this.argumentOfPeriapsis);
         this.velOut = Kepler.GetVelocity(this.semiMajorAxis, radius, this.meanMotion, this.eccentricAnomnalyOut, this.trueAnomalyOut, this.eccentricity, this.argumentOfPeriapsis);
     }
 }