Returns the "distance" in radians (about the spheres centre) between two positions.
Calculates the angular between two points on the surface of a sphere relative to the centre of the sphere. This calculation is made using:
- the distance in radian about the center of the sphere.
Applies a simple conversion to the distance calculated by angularDistance to give a more conventional measure of distance according to the specified conversion ratio. This is simple the circumference of the sphere divided by . For example, with the planet earth on degree is divided into 60, which is called 1 minute of arc. This is also one nautical mile. Therefore to convert radian to nautical miles (knots) you muliply by:
Position start(10,-90); Position end(45,20); printf("\nKnots = %lf", distance(start, end)); printf("\nMiles = %lf", distance(start, end, 3956.0881));
start Constant end a Position reference designating the target location at [Latitude,Longitude]. radToDist Default Value = 3437.7475
- a Range argument representing the distance to new position, also equal to the 'distance' parameter.