private double CalcInterceptAngle(Orbit targetOrbit, Orbit originOrbit) { double originRadius = (originOrbit.semiMinorAxis + originOrbit.semiMajorAxis) * 0.5; double targetRadius = (targetOrbit.semiMinorAxis + targetOrbit.semiMajorAxis) * 0.5; double angle = 180.0 * (1.0 - Math.Pow((originRadius + targetRadius) / (2.0 * targetRadius), 1.5)); angle = PhaseAngle - angle; return(RelativeInclination < 90.0 ? AngleHelper.Clamp360(angle) : AngleHelper.Clamp360(360.0 - (180.0 - angle))); }
public override void Draw(SectionModule section) { var target = FlightGlobals.fetch.VesselTarget?.GetVessel(); if (target != null) { double latitude = AngleHelper.Clamp360(target.latitude); DrawLine(Units.ToAngleDMS(latitude) + (latitude < 0 ? " S" : " N"), section.IsHud); } }
public static double GetAngleToRetrograde(this Orbit orbit, double universalTime) { if (orbit.referenceBody == CelestialBodies.SystemBody.CelestialBody) { return(0.0); } Vector3d orbitVector = orbit.getRelativePositionAtUT(universalTime); orbitVector.z = 0.0; Vector3d bodyVector = orbit.referenceBody.orbit.getOrbitalVelocityAtUT(universalTime); bodyVector.z = 0.0; double angle = AngleHelper.GetAngleBetweenVectors(-bodyVector, orbitVector); return(AngleHelper.Clamp360(orbit.inclination < 90.0 ? angle : 360.0 - angle)); }
public static double GetAngleToTrueAnomaly(this Orbit orbit, double trueAnomaly) { return(AngleHelper.Clamp360(trueAnomaly - orbit.trueAnomaly)); }
public static double GetAngleToTrueAnomaly(Orbit orbit, double trueAnomaly) { return(AngleHelper.Clamp360(trueAnomaly - (orbit.trueAnomaly * Units.RAD_TO_DEG))); }