Merge pull request #100 from Gerry1135/trueanomaly
Merge pull request #100 from Gerry1135/trueanomaly

Fix for issue #99

--- a/KerbalEngineer/Extensions/OrbitExtensions.cs
+++ b/KerbalEngineer/Extensions/OrbitExtensions.cs
@@ -97,7 +97,7 @@
 
         public static double GetAngleToTrueAnomaly(this Orbit orbit, double trueAnomaly)
         {
-            return AngleHelper.Clamp360(trueAnomaly - orbit.trueAnomaly);
+            return AngleHelper.Clamp360(trueAnomaly - (orbit.trueAnomaly * Units.RAD_TO_DEG));
         }
 
         public static double GetAngleToVector(this Orbit orbit, Vector3d vector)

--- a/KerbalEngineer/Flight/Readouts/Orbital/TrueAnomaly.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/TrueAnomaly.cs
@@ -22,6 +22,7 @@
 using System;
 
 using KerbalEngineer.Extensions;
+using KerbalEngineer.Helpers;
 using KerbalEngineer.Flight.Sections;
 
 #endregion
@@ -46,7 +47,7 @@
 
         public override void Draw(SectionModule section)
         {
-            this.DrawLine(FlightGlobals.ship_orbit.trueAnomaly.ToAngle(), section.IsHud);
+            this.DrawLine((FlightGlobals.ship_orbit.trueAnomaly * Units.RAD_TO_DEG).ToAngle(), section.IsHud);
         }
 
         #endregion

--- a/KerbalEngineer/Flight/Readouts/Surface/ImpactProcessor.cs
+++ b/KerbalEngineer/Flight/Readouts/Surface/ImpactProcessor.cs
@@ -22,6 +22,7 @@
 using System;
 
 using UnityEngine;
+using KerbalEngineer.Helpers;
 
 #endregion
 
@@ -113,7 +114,7 @@
                 this.impactAltitude = 0;
                 var e = FlightGlobals.ActiveVessel.orbit.eccentricity;
                 //get current position direction vector
-                var currentpos = this.RadiusDirection(FlightGlobals.ActiveVessel.orbit.trueAnomaly * 180.0 / Math.PI);
+                var currentpos = this.RadiusDirection(FlightGlobals.ActiveVessel.orbit.trueAnomaly * Units.RAD_TO_DEG);
                 //calculate longitude in inertial reference frame from that
                 var currentirflong = 180 * Math.Atan2(currentpos.x, currentpos.y) / Math.PI;