/// <summary> /// Standard constructor. /// </summary> /// <param name="tle">Two-line element orbital parameters.</param> public Orbit(Tle tle) { Tle = tle; Epoch = Tle.EpochJulian; m_Inclination = GetRad(Tle.Field.Inclination); m_Eccentricity = Tle.GetField(Tle.Field.Eccentricity); m_RAAN = GetRad(Tle.Field.Raan); m_ArgPerigee = GetRad(Tle.Field.ArgPerigee); m_BStar = Tle.GetField(Tle.Field.BStarDrag); m_Drag = Tle.GetField(Tle.Field.MeanMotionDt); m_MeanAnomaly = GetRad(Tle.Field.MeanAnomaly); m_TleMeanMotion = Tle.GetField(Tle.Field.MeanMotion); // Recover the original mean motion and semimajor axis from the // input elements. double mm = TleMeanMotion; double rpmin = mm * Globals.TwoPi / Globals.MinPerDay; // rads per minute double a1 = Math.Pow(Globals.Xke / rpmin, 2.0 / 3.0); double e = Eccentricity; double i = Inclination; double temp = (1.5 * Globals.Ck2 * (3.0 * Globals.Sqr(Math.Cos(i)) - 1.0) / Math.Pow(1.0 - e * e, 1.5)); double delta1 = temp / (a1 * a1); double a0 = a1 * (1.0 - delta1 * ((1.0 / 3.0) + delta1 * (1.0 + 134.0 / 81.0 * delta1))); double delta0 = temp / (a0 * a0); m_rmMeanMotionRec = rpmin / (1.0 + delta0); m_aeAxisSemiMajorRec = a0 / (1.0 - delta0); m_aeAxisSemiMinorRec = m_aeAxisSemiMajorRec * Math.Sqrt(1.0 - (e * e)); m_kmPerigeeRec = Globals.Xkmper * (m_aeAxisSemiMajorRec * (1.0 - e) - Globals.Ae); m_kmApogeeRec = Globals.Xkmper * (m_aeAxisSemiMajorRec * (1.0 + e) - Globals.Ae); if (Period.TotalMinutes >= 225.0) { // SDP4 - period >= 225 minutes. NoradModel = new NoradSDP4(this); } else { // SGP4 - period < 225 minutes NoradModel = new NoradSGP4(this); } }
/// <summary> /// Standard constructor. /// </summary> /// <param name="tle">Two-line element orbital parameters.</param> public Orbit(Tle tle) { Tle = tle; Epoch = Tle.EpochJulian; m_Inclination = GetRad(Tle.Field.Inclination); m_Eccentricity = Tle.GetField(Tle.Field.Eccentricity); m_RAAN = GetRad(Tle.Field.Raan); m_ArgPerigee = GetRad(Tle.Field.ArgPerigee); m_BStar = Tle.GetField(Tle.Field.BStarDrag); m_Drag = Tle.GetField(Tle.Field.MeanMotionDt); m_MeanAnomaly = GetRad(Tle.Field.MeanAnomaly); m_TleMeanMotion = Tle.GetField(Tle.Field.MeanMotion); // Recover the original mean motion and semimajor axis from the // input elements. double mm = TleMeanMotion; double rpmin = mm * Globals.TwoPi / Globals.MinPerDay; // rads per minute double a1 = Math.Pow(Globals.Xke / rpmin, 2.0 / 3.0); double e = Eccentricity; double i = Inclination; double temp = (1.5 * Globals.Ck2 * (3.0 * Globals.Sqr(Math.Cos(i)) - 1.0) / Math.Pow(1.0 - e * e, 1.5)); double delta1 = temp / (a1 * a1); double a0 = a1 * (1.0 - delta1 * ((1.0 / 3.0) + delta1 * (1.0 + 134.0 / 81.0 * delta1))); double delta0 = temp / (a0 * a0); m_rmMeanMotionRec = rpmin / (1.0 + delta0); m_aeAxisSemiMajorRec = a0 / (1.0 - delta0); m_aeAxisSemiMinorRec = m_aeAxisSemiMajorRec * Math.Sqrt(1.0 - (e * e)); m_kmPerigeeRec = Globals.Xkmper * (m_aeAxisSemiMajorRec * (1.0 - e) - Globals.Ae); m_kmApogeeRec = Globals.Xkmper * (m_aeAxisSemiMajorRec * (1.0 + e) - Globals.Ae); if ((Period.Ticks * 1.66666666666667E-09) >= 225.0) { // SDP4 - period >= 225 minutes. NoradModel = new NoradSDP4(this); } else { // SGP4 - period < 225 minutes NoradModel = new NoradSGP4(this); } }