/// <summary> /// Calculates the great circle path from x to y, and returns heading departing x. /// x and y should be unique. /// </summary> /// <exception cref="ArgumentException"></exception> public static double TrueHeading(ICoordinate x, ICoordinate y) { if (x.LatLonEquals(y)) { throw new ArgumentException(); } return(TrueHeading(GetW(x.ToVector3D(), y.ToVector3D()), x)); }
// delta: in degrees public double GetAirDistance(ICoordinate point1, ICoordinate point2, double delta = 1.0) { if (point1.LatLonEquals(point2, 1E-5)) { return(0.0); } v1 = point1.ToVector3D(); v2 = point2.ToVector3D(); double deltaAlpha = ToRadian(delta); // Total distance double r = EarthRadiusNm * SafeAcos(v1.Dot(v2)); // Total time required double time = Integrate(GetOneOverGS, 0.0, r, deltaAlpha * EarthRadiusNm); return(time * Ktas); }