Fixed bug in phase angle calculations.
Fixed bug in phase angle calculations.

--- a/Documents/CHANGES.txt
+++ b/Documents/CHANGES.txt
@@ -1,5 +1,7 @@
 1.0.9.4
     Added: Switch to function on the Target Selector readout.
+    Fixed: Flight Engineer not saving its hidden state.
+    Fixed: Bug in the phase angle calculations.
 
 1.0.9.3
     Added: Title of the build engineer in compact mode now shows if you are using atmospheric data.

--- a/KerbalEngineer/Extensions/OrbitExtensions.cs
+++ b/KerbalEngineer/Extensions/OrbitExtensions.cs
@@ -57,11 +57,11 @@
             }
 
             var angle = AngleHelper.GetAngleBetweenVectors(orbit.getRelativePositionAtUT(Planetarium.GetUniversalTime()),
-                                            Vector3d.Exclude(orbit.GetOrbitNormal(), orbit.referenceBody.orbit.getRelativePositionAtUT(Planetarium.GetUniversalTime())));
+                                                           Vector3d.Exclude(orbit.GetOrbitNormal(), orbit.referenceBody.orbit.getRelativePositionAtUT(Planetarium.GetUniversalTime())));
 
-            angle = AngleHelper.Clamp360(angle + 90.0);
+            angle = AngleHelper.Clamp360(angle - 90.0);
 
-            return orbit.inclination <= 90.0 ? angle : 360.0 - angle;
+            return orbit.inclination > 90.0 ? angle : 360.0 - angle;
         }
 
         public static double GetAngleToRetrograde(this Orbit orbit)
@@ -72,11 +72,11 @@
             }
 
             var angle = AngleHelper.GetAngleBetweenVectors(orbit.getRelativePositionAtUT(Planetarium.GetUniversalTime()),
-                                            Vector3d.Exclude(orbit.GetOrbitNormal(), orbit.referenceBody.orbit.getRelativePositionAtUT(Planetarium.GetUniversalTime())));
+                                                           Vector3d.Exclude(orbit.GetOrbitNormal(), orbit.referenceBody.orbit.getRelativePositionAtUT(Planetarium.GetUniversalTime())));
 
-            angle = AngleHelper.Clamp360(angle - 90.0);
+            angle = AngleHelper.Clamp360(angle + 90.0);
 
-            return orbit.inclination <= 90.0 ? angle : 360.0 - angle;
+            return orbit.inclination > 90.0 ? angle : 360.0 - angle;
         }
 
         public static double GetAngleToTrueAnomaly(this Orbit orbit, double trueAnomaly)
@@ -91,9 +91,8 @@
 
         public static double GetPhaseAngle(this Orbit orbit, Orbit target)
         {
-            return orbit.inclination <= 90.0
-                ? AngleHelper.GetAngleBetweenVectors(orbit.pos, Vector3d.Exclude(orbit.GetOrbitNormal(), target.pos))
-                : AngleHelper.GetAngleBetweenVectors(Vector3d.Exclude(orbit.GetOrbitNormal(), target.pos), orbit.pos);
+            var angle = AngleHelper.GetAngleBetweenVectors(Vector3d.Exclude(orbit.GetOrbitNormal(), target.pos), orbit.pos);
+            return (orbit.semiMajorAxis < target.semiMajorAxis) ? angle : angle - 360.0;
         }
 
         public static double GetRelativeInclination(this Orbit orbit, Orbit target)

--- a/KerbalEngineer/Flight/Readouts/Rendezvous/RendezvousProcessor.cs
+++ b/KerbalEngineer/Flight/Readouts/Rendezvous/RendezvousProcessor.cs
@@ -206,8 +206,9 @@
 
         private double CalcInterceptAngle()
         {
-            // Only works when going into higher orbits.  Need to figure out a way for it to work with lower orbits.
-            var angle = 180.0 * (1.0 - Math.Pow((this.originOrbit.radius + this.targetOrbit.radius) / (2.0 * this.targetOrbit.radius), 1.5));
+            var originRadius = (originOrbit.semiMinorAxis + originOrbit.semiMajorAxis) * 0.5;
+            var targetRadius = (targetOrbit.semiMinorAxis + targetOrbit.semiMajorAxis) * 0.5;
+            var 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));
         }

 Binary files a/Output/KerbalEngineer/KerbalEngineer.dll and b/Output/KerbalEngineer/KerbalEngineer.dll differ