/// <summary>
 ///     Calculate range, altitude delta and bearing
 /// </summary>
 /// <param name="battery"></param>
 /// <param name="target"></param>
 public static Output1 Calculate1(Coords battery, Coords target)
 {
     var output = new Output1();
     double a = target.X - battery.X;
     double b = target.Y - battery.Y;
     output.Range = 10*Math.Sqrt(Math.Pow(a, 2) + Math.Pow(b, 2));
     output.DeltaAlt = target.Z - battery.Z;
     if (Math.Abs(a) > double.Epsilon)
     {
         output.Bearing = -Math.Atan(b/a)*(180/Math.PI) + 180 - 90*Math.Sign(a);
     }
     else if (b < 0)
     {
         output.Bearing = 180;
     }
     else
     {
         output.Bearing = 0;
     }
     return output;
 }
 public HttpStatusCode CodeFor(Output1 output)
 {
     return HttpStatusCode.Unused;
 }