### Question:
AngleCalc { public double calcOrientation( double lat1, double lon1, double lat2, double lon2 ) { double shrinkFactor = cos(toRadians((lat1 + lat2) / 2)); return Math.atan2((lat2 - lat1), shrinkFactor * (lon2 - lon1)); }  double calcOrientation( double lat1, double lon1, double lat2, double lon2 ); double convertAzimuth2xaxisAngle(double azimuth); double alignOrientation( double baseOrientation, double orientation );  }### Answer:
@Test public void testOrientation() { assertEquals(90.0, Math.toDegrees(ac.calcOrientation(0, 0, 1, 0)), 0.01); assertEquals(45.0, Math.toDegrees(ac.calcOrientation(0, 0, 1, 1)), 0.01); assertEquals(0.0, Math.toDegrees(ac.calcOrientation(0, 0, 0, 1)), 0.01); assertEquals(-45.0, Math.toDegrees(ac.calcOrientation(0, 0, -1, 1)), 0.01); assertEquals(-135.0, Math.toDegrees(ac.calcOrientation(0, 0, -1, -1)), 0.01); assertEquals(90 - 32.76, Math.toDegrees(ac.calcOrientation(49.942, 11.580, 49.944, 11.582)), 0.01); assertEquals(-90 - 32.76, Math.toDegrees(ac.calcOrientation(49.944, 11.582, 49.942, 11.580)), 0.01); }