• https://me.yahoo.com
COST (GBP)
0.54
0.00
0

# angular Distance

Returns the "distance" in radians (about the spheres centre) between two positions.

C++

## AngularDistance

 doubleangularDistance( const Position& start const Position& end )
Calculates the angular between two points on the surface of a sphere relative to the centre of the sphere.

$dist&space;=&space;cos^{-1}&space;\left&space;[&space;sin(a_{lat})&space;sin(b_{lat})&space;+&space;cos(a_{lat})&space;cos(b_{lat})&space;cos(b_{long}&space;-&space;a_{long})&space;\right&space;]$
where a and b are the start and end location.

### Parameters

 start the first Position [Latitude, Longitude]. end the second Position [latitude, Longitude].

### Returns

##### Source Code

Source code is available when you agree to a GP Licence or buy a Commercial Licence.

Not a member, then Register with CodeCogs. Already a Member, then Login.

## Distance

 doubledistance( const Position& start const Position& end double radToDist = 3437.7475 )
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 $\inline&space;2&space;pi$. 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:
$\frac{360.0&space;\cdot&space;60}{2&space;\pi}$

### Example 1

Position start(10,-90);
Position end(45,20);
printf("\nKnots = %lf", distance(start, end));
printf("\nMiles = %lf", distance(start, end, 3956.0881));

### Parameters

 start Constant end a Position reference designating the target location at [Latitude,Longitude]. radToDist Default Value = 3437.7475

### Returns

a Range argument representing the distance to new position, also equal to the 'distance' parameter.
##### Source Code

Source code is available when you agree to a GP Licence or buy a Commercial Licence.

Not a member, then Register with CodeCogs. Already a Member, then Login.