Concept

Haversine formula

Summary
The haversine formula determines the great-circle distance between two points on a sphere given their longitudes and latitudes. Important in navigation, it is a special case of a more general formula in spherical trigonometry, the law of haversines, that relates the sides and angles of spherical triangles. The first table of haversines in English was published by James Andrew in 1805, but Florian Cajori credits an earlier use by José de Mendoza y Ríos in 1801. The term haversine was coined in 1835 by James Inman. These names follow from the fact that they are customarily written in terms of the haversine function, given by hav(θ) = sin2(θ/2). The formulas could equally be written in terms of any multiple of the haversine, such as the older versine function (twice the haversine). Prior to the advent of computers, the elimination of division and multiplication by factors of two proved convenient enough that tables of haversine values and logarithms were included in 19th- and early 20th-century navigation and trigonometric texts. These days, the haversine form is also convenient in that it has no coefficient in front of the sin2 function. Let the central angle θ between any two points on a sphere be: where: d is the distance between the two points along a great circle of the sphere (see spherical distance), r is the radius of the sphere. The haversine formula allows the haversine of θ (that is, hav(θ)) to be computed directly from the latitude (represented by φ) and longitude (represented by λ) of the two points: where φ1, φ2 are the latitude of point 1 and latitude of point 2, λ1, λ2 are the longitude of point 1 and longitude of point 2. Finally, the haversine function hav(θ), applied above to both the central angle θ and the differences in latitude and longitude, is The haversine function computes half a versine of the angle θ. To solve for the distance d, apply the archaversine (inverse haversine) to h = hav(θ) or use the arcsine (inverse sine) function: or more explicitly: When using these formulae, one must ensure that h does not exceed 1 due to a floating point error (d is only real for 0 ≤ h ≤ 1).
About this result
This page is automatically generated and may contain information that is not correct, complete, up-to-date, or relevant to your search query. The same applies to every other page on this website. Please make sure to verify the information with EPFL's official sources.