/// <summary> /// Gets the UT for the equatorial AN. /// </summary> /// <returns>The equatorial AN UT.</returns> /// <param name="o">The Orbit to calculate the UT from.</param> internal static double getEquatorialANUT(this Orbit o) { //TODO: Add safeguards for bad UTs, may need to be refactored to NodeManager return(o.GetUTforTrueAnomaly(o.GetTrueAnomalyOfZupVector(o.GetANVector()), 2)); }
/// <summary> /// /// </summary> /// <param name="o">O.</param> private static void Print_Orbit_info(Orbit o) { if (o == null) { Debug.Log("Orbit is null"); return; } string Output = ""; Output += "Orbit Info \n"; Output += "\n activePatch:" + o.activePatch ; Output += "\n altitude:"+ o.altitude ; //Output += "\n an:"+ o.an ; //Output += "\n ApA:"+ o.ApA ; //Output += "\n ApR:"+ o.ApR ; Output += "\n argumentOfPeriapsis:"+ o.argumentOfPeriapsis ; //Output += "\n ClAppr:"+ o.ClAppr ; //Output += "\n ClEctr1:"+ o.ClEctr1 ; //Output += "\n ClEctr2:"+ o.ClEctr2 ; Output += "\n closestEncounterBody:"+ o.closestEncounterBody ; Output += "\n closestEncounterLevel:"+ o.closestEncounterLevel ; Output += "\n closestEncounterPatch:"+ o.closestEncounterPatch ; Output += "\n closestTgtApprUT:"+ o.closestTgtApprUT ; //Output += "\n CrAppr:"+ o.CrAppr ; //Output += "\n debugAN:"+ o.debugAN ; //Output += "\n debugEccVec:"+ o.debugEccVec ; //Output += "\n debugH:"+ o.debugH ; //Output += "\n debugPos:"+ o.debugPos ; //Output += "\n debugVel:"+ o.debugVel ; //Output += "\n debug_returnFullEllipseTrajectory:"+ o.debug_returnFullEllipseTrajectory ; //Output += "\n E:"+ o.E ; //Output += "\n eccentricAnomaly:"+ o.eccentricAnomaly ; //Output += "\n eccentricity:"+ o.eccentricity ; //Output += "\n eccVec:"+ o.eccVec ; //Output += "\n EndUT:"+ o.EndUT ; Output += "\n epoch:"+ o.epoch ; //Output += "\n FEVp:"+ o.FEVp; //Output += "\n FEVs:"+ o.FEVs ; //Output += "\n fromE:"+ o.fromE ; //Output += "\n fromV:"+ o.fromV ; //Output += "\n h:"+ o.h ; //Output += "\n inclination:"+ o.inclination ; //Output += "\n LAN:"+ o.LAN ; //Output += "\n mag:"+ o.mag ; //Output += "\n meanAnomaly:"+ o.meanAnomaly ; //Output += "\n meanAnomalyAtEpoch:"+ o.meanAnomalyAtEpoch ; Output += "\n nearestTT:"+ o.nearestTT ; Output += "\n nextPatch:"+ o.nextPatch ; Output += "\n nextTT:"+ o.nextTT ; //Output += "\n ObT:"+ o.ObT ; Output += "\n ObTAtEpoch :"+ o.ObTAtEpoch ; //Output += "\n orbitalEnergy :"+ o.orbitalEnergy ; //Output += "\n orbitalSpeed:"+ o.orbitalSpeed ; //Output += "\n orbitPercent :"+ o.orbitPercent ; Output += "\n patchEndTransition :"+ o.patchEndTransition ; Output += "\n patchStartTransition :"+ o.patchStartTransition ; //Output += "\n period :"+ o.period ; //Output += "\n pos :"+ o.pos ; Output += "\n previousPatch :"+ o.previousPatch ; //Output += "\n radius :"+ o.radius ; Output += "\n referenceBody :"+ o.referenceBody ; //Output += "\n sampleInterval :"+ o.sampleInterval ; Output += "\n secondaryPosAtTransition1 :"+ o.secondaryPosAtTransition1 ; Output += "\n secondaryPosAtTransition2 :"+ o.secondaryPosAtTransition2 ; //Output += "\n semiLatusRectum :"+ o.semiLatusRectum ; //Output += "\n semiMajorAxis :"+ o.semiMajorAxis ; //Output += "\n semiMinorAxis :"+ o.semiMinorAxis ; //Output += "\n SEVp :"+ o.SEVp ; //Output += "\n SEVs :"+ o.SEVs ; //Output += "\n StartUT :"+ o.StartUT ; Output += "\n timeToAp :"+ o.timeToAp ; Output += "\n timeToPe :"+ o.timeToPe ; Output += "\n timeToTransition1 :"+ o.timeToTransition1 ; Output += "\n timeToTransition2 :"+ o.timeToTransition2 ; //Output += "\n toE :"+ o.toE ; //Output += "\n toV :"+ o.toV ; //Output += "\n trueAnomaly :"+ o.trueAnomaly ; //Output += "\n UTappr :"+ o.UTappr ; //Output += "\n UTsoi :"+ o.UTsoi ; //Output += "\n V :"+ o.V ; //Output += "\n vel :"+ o.vel ; Debug.Log(Output); if (!o.activePatch) { return; } try{ //Functions Output = "Orbit Functions: \n"; Output += "\n PeA :"+ o.PeA ; Output += "\n PeR :"+ o.PeR ; Output += "\n GetANVector:"+ o.GetANVector() ; Output += "\n GetEccVector:"+ o.GetEccVector() ; Output += "\n GetFrameVel:"+ o.GetFrameVel() ; Output += "\n GetHashCode:"+ o.GetHashCode() ; Output += "\n GetOrbitNormal:"+ o.GetOrbitNormal() ; Output += "\n GetRelativeVel:"+ o.GetRelativeVel() ; Output += "\n GetType:"+ o.GetType() ; Output += "\n GetVel:"+ o.GetVel() ; Output += "\n GetWorldSpaceVel:"+ o.GetWorldSpaceVel() ; //Unused Funtion (Tests?) // Output += "\n :"+ o.DrawOrbit; // Output += "\n :"+ o.Equals ; // Output += "\n :"+ o.GetDTforTrueAnomaly() ; // Output += "\n :"+ o.GetEccentricAnomaly ; // Output += "\n :"+ o.GetFrameVelAtUT ; // Output += "\n :"+ o.GetMeanAnomaly ; // Output += "\n :"+ o.getObTAtMeanAnomaly ; // Output += "\n :"+ o.getObtAtUT ; // Output += "\n :"+ o.getOrbitalSpeedAt ; // Output += "\n :"+ o.getOrbitalSpeedAtDistance ; // Output += "\n :"+ o.getOrbitalSpeedAtPos ; // Output += "\n :"+ o.getOrbitalSpeedAtRelativePos ; // Output += "\n :"+ o.getOrbitalVelocityAtObT ; // Output += "\n :"+ o.getOrbitalVelocityAtUT ; // Output += "\n :"+ o.GetPatchTrajectory ; // Output += "\n :"+ o.getPositionAtT ; // Output += "\n :"+ o.getPositionAtUT ; // Output += "\n :"+ o.getPositionFromEccAnomaly ; // Output += "\n :"+ o.getPositionFromMeanAnomaly ; // Output += "\n :"+ o.getPositionFromTrueAnomaly ; // Output += "\n :"+ o.getRelativePositionAtT ; // Output += "\n :"+ o.getRelativePositionAtUT ; // Output += "\n :"+ o.getRelativePositionFromEccAnomaly ; // Output += "\n :"+ o.getRelativePositionFromMeanAnomaly ; // Output += "\n :"+ o.getRelativePositionFromTrueAnomaly ; // Output += "\n :"+ o.GetRotFrameVel ; // Output += "\n :"+ o.getTrueAnomaly ; // Output += "\n :"+ o.GetTrueAnomalyOfZupVector ; // Output += "\n :"+ o.getTruePositionAtUT ; // Output += "\n :"+ o.GetUTforTrueAnomaly ; // Output += "\n :"+ o.Init() ; // Output += "\n :"+ o.RadiusAtTrueAnomaly ; // Output += "\n :"+ o.solveEccentricAnomaly ; // Output += "\n :"+ o.TrueAnomalyAtRadius ; // Output += "\n :"+ o.TrueAnomalyAtT ; // Output += "\n :"+ o.TrueAnomalyAtUT; // Output += "\n :"+ o.UpdateFromOrbitAtUT; // Output += "\n :"+ o.UpdateFromStateVectors; // Output += "\n :"+ o.UpdateFromUT; } catch(Exception ex) { Debug.Log("Could not orbit functions. Exception:" + ex); //no catch exception for now. } Debug.Log(Output); Debug.Log("Patch from o.nextPatch"); Print_Orbit_info (o.nextPatch); Debug.Log("Patch from o.closestEncounterPatch"); Print_Orbit_info (o.closestEncounterPatch); Output = ""; }
/// <summary> /// /// </summary> /// <param name="o">O.</param> private static void Print_Orbit_info(Orbit o) { if (o == null) { Debug.Log("Orbit is null"); return; } string Output = ""; Output += "Orbit Info \n"; Output += "\n activePatch:" + o.activePatch; Output += "\n altitude:" + o.altitude; //Output += "\n an:"+ o.an ; //Output += "\n ApA:"+ o.ApA ; //Output += "\n ApR:"+ o.ApR ; Output += "\n argumentOfPeriapsis:" + o.argumentOfPeriapsis; //Output += "\n ClAppr:"+ o.ClAppr ; //Output += "\n ClEctr1:"+ o.ClEctr1 ; //Output += "\n ClEctr2:"+ o.ClEctr2 ; Output += "\n closestEncounterBody:" + o.closestEncounterBody; Output += "\n closestEncounterLevel:" + o.closestEncounterLevel; Output += "\n closestEncounterPatch:" + o.closestEncounterPatch; Output += "\n closestTgtApprUT:" + o.closestTgtApprUT; //Output += "\n CrAppr:"+ o.CrAppr ; //Output += "\n debugAN:"+ o.debugAN ; //Output += "\n debugEccVec:"+ o.debugEccVec ; //Output += "\n debugH:"+ o.debugH ; //Output += "\n debugPos:"+ o.debugPos ; //Output += "\n debugVel:"+ o.debugVel ; //Output += "\n debug_returnFullEllipseTrajectory:"+ o.debug_returnFullEllipseTrajectory ; //Output += "\n E:"+ o.E ; //Output += "\n eccentricAnomaly:"+ o.eccentricAnomaly ; //Output += "\n eccentricity:"+ o.eccentricity ; //Output += "\n eccVec:"+ o.eccVec ; //Output += "\n EndUT:"+ o.EndUT ; Output += "\n epoch:" + o.epoch; //Output += "\n FEVp:"+ o.FEVp; //Output += "\n FEVs:"+ o.FEVs ; //Output += "\n fromE:"+ o.fromE ; //Output += "\n fromV:"+ o.fromV ; //Output += "\n h:"+ o.h ; //Output += "\n inclination:"+ o.inclination ; //Output += "\n LAN:"+ o.LAN ; //Output += "\n mag:"+ o.mag ; //Output += "\n meanAnomaly:"+ o.meanAnomaly ; //Output += "\n meanAnomalyAtEpoch:"+ o.meanAnomalyAtEpoch ; Output += "\n nearestTT:" + o.nearestTT; Output += "\n nextPatch:" + o.nextPatch; Output += "\n nextTT:" + o.nextTT; //Output += "\n ObT:"+ o.ObT ; Output += "\n ObTAtEpoch :" + o.ObTAtEpoch; //Output += "\n orbitalEnergy :"+ o.orbitalEnergy ; //Output += "\n orbitalSpeed:"+ o.orbitalSpeed ; //Output += "\n orbitPercent :"+ o.orbitPercent ; Output += "\n patchEndTransition :" + o.patchEndTransition; Output += "\n patchStartTransition :" + o.patchStartTransition; //Output += "\n period :"+ o.period ; //Output += "\n pos :"+ o.pos ; Output += "\n previousPatch :" + o.previousPatch; //Output += "\n radius :"+ o.radius ; Output += "\n referenceBody :" + o.referenceBody; //Output += "\n sampleInterval :"+ o.sampleInterval ; Output += "\n secondaryPosAtTransition1 :" + o.secondaryPosAtTransition1; Output += "\n secondaryPosAtTransition2 :" + o.secondaryPosAtTransition2; //Output += "\n semiLatusRectum :"+ o.semiLatusRectum ; //Output += "\n semiMajorAxis :"+ o.semiMajorAxis ; //Output += "\n semiMinorAxis :"+ o.semiMinorAxis ; //Output += "\n SEVp :"+ o.SEVp ; //Output += "\n SEVs :"+ o.SEVs ; //Output += "\n StartUT :"+ o.StartUT ; Output += "\n timeToAp :" + o.timeToAp; Output += "\n timeToPe :" + o.timeToPe; Output += "\n timeToTransition1 :" + o.timeToTransition1; Output += "\n timeToTransition2 :" + o.timeToTransition2; //Output += "\n toE :"+ o.toE ; //Output += "\n toV :"+ o.toV ; //Output += "\n trueAnomaly :"+ o.trueAnomaly ; //Output += "\n UTappr :"+ o.UTappr ; //Output += "\n UTsoi :"+ o.UTsoi ; //Output += "\n V :"+ o.V ; //Output += "\n vel :"+ o.vel ; Debug.Log(Output); if (!o.activePatch) { return; } try{ //Functions Output = "Orbit Functions: \n"; Output += "\n PeA :" + o.PeA; Output += "\n PeR :" + o.PeR; Output += "\n GetANVector:" + o.GetANVector(); Output += "\n GetEccVector:" + o.GetEccVector(); Output += "\n GetFrameVel:" + o.GetFrameVel(); Output += "\n GetHashCode:" + o.GetHashCode(); Output += "\n GetOrbitNormal:" + o.GetOrbitNormal(); Output += "\n GetRelativeVel:" + o.GetRelativeVel(); Output += "\n GetType:" + o.GetType(); Output += "\n GetVel:" + o.GetVel(); Output += "\n GetWorldSpaceVel:" + o.GetWorldSpaceVel(); //Unused Funtion (Tests?) // Output += "\n :"+ o.DrawOrbit; // Output += "\n :"+ o.Equals ; // Output += "\n :"+ o.GetDTforTrueAnomaly() ; // Output += "\n :"+ o.GetEccentricAnomaly ; // Output += "\n :"+ o.GetFrameVelAtUT ; // Output += "\n :"+ o.GetMeanAnomaly ; // Output += "\n :"+ o.getObTAtMeanAnomaly ; // Output += "\n :"+ o.getObtAtUT ; // Output += "\n :"+ o.getOrbitalSpeedAt ; // Output += "\n :"+ o.getOrbitalSpeedAtDistance ; // Output += "\n :"+ o.getOrbitalSpeedAtPos ; // Output += "\n :"+ o.getOrbitalSpeedAtRelativePos ; // Output += "\n :"+ o.getOrbitalVelocityAtObT ; // Output += "\n :"+ o.getOrbitalVelocityAtUT ; // Output += "\n :"+ o.GetPatchTrajectory ; // Output += "\n :"+ o.getPositionAtT ; // Output += "\n :"+ o.getPositionAtUT ; // Output += "\n :"+ o.getPositionFromEccAnomaly ; // Output += "\n :"+ o.getPositionFromMeanAnomaly ; // Output += "\n :"+ o.getPositionFromTrueAnomaly ; // Output += "\n :"+ o.getRelativePositionAtT ; // Output += "\n :"+ o.getRelativePositionAtUT ; // Output += "\n :"+ o.getRelativePositionFromEccAnomaly ; // Output += "\n :"+ o.getRelativePositionFromMeanAnomaly ; // Output += "\n :"+ o.getRelativePositionFromTrueAnomaly ; // Output += "\n :"+ o.GetRotFrameVel ; // Output += "\n :"+ o.getTrueAnomaly ; // Output += "\n :"+ o.GetTrueAnomalyOfZupVector ; // Output += "\n :"+ o.getTruePositionAtUT ; // Output += "\n :"+ o.GetUTforTrueAnomaly ; // Output += "\n :"+ o.Init() ; // Output += "\n :"+ o.RadiusAtTrueAnomaly ; // Output += "\n :"+ o.solveEccentricAnomaly ; // Output += "\n :"+ o.TrueAnomalyAtRadius ; // Output += "\n :"+ o.TrueAnomalyAtT ; // Output += "\n :"+ o.TrueAnomalyAtUT; // Output += "\n :"+ o.UpdateFromOrbitAtUT; // Output += "\n :"+ o.UpdateFromStateVectors; // Output += "\n :"+ o.UpdateFromUT; } catch (Exception ex) { Debug.Log("Could not orbit functions. Exception:" + ex); //no catch exception for now. } Debug.Log(Output); Debug.Log("Patch from o.nextPatch"); Print_Orbit_info(o.nextPatch); Debug.Log("Patch from o.closestEncounterPatch"); Print_Orbit_info(o.closestEncounterPatch); Output = ""; }
/// <summary> /// Gets the UT for the equatorial AN. /// </summary> /// <returns>The equatorial AN UT.</returns> /// <param name="o">The Orbit to calculate the UT from.</param> public static double getEquatorialANUT(Orbit o) { //TODO: Add safeguards for bad UTs, may need to be refactored to NodeManager return o.GetUTforTrueAnomaly(o.GetTrueAnomalyOfZupVector(o.GetANVector()), 2); }