Returns the "distance" in radians (about the spheres centre) between two positions.
Dependents
this module uses 2 subunits
Position
Interface
#include <codecogs/maths/geometry/spherical/angulardistance.h >
double angularDistance (const Position &start, const Position &end)Returns the "distance" in radians (about the spheres centre) between two positions.
double distance (const Position &start, const Position &end, double radToDist=3437.7475)Returns the distance from the start position to the 'end' position.
Use the following HTML code to embed the calculators within other websites:
AngularDistance Calculates the angular between two points on the surface of a sphere relative to the centre of the sphere.
This calculation is made using:
where
a and
b are the start and end location.
Parameters start the first Position [Latitude, Longitude]. end the second Position [latitude, Longitude].
Returns the distance in radian about the center of the sphere. 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 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:
<table>
<tr><td align="middle"><strong>Description</strong></td><td align="middle"><strong>radToDist</strong></td></tr>
<tr><td>Nautical Mile on Earth</td><td>3437.7475 knots/radian</td></tr>
<tr><td>Miles on Earth</td><td>3956.0881 miles/radian</td></tr>
<tr><td>kilometers on Earth</td><td>6366.7070 km/radian</td></tr>
</table>
Example 1 Position start( 10 ,- 90 ) ;
Position end( 45 ,20 ) ;
printf ( "\n Knots = %lf" , distance( start, end) ) ;
printf ( "\n Miles = %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 .