ArticleslgStudy

mathematics

Haversine formula

Haversine formula is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Haversine formula rather than just read about it. In short: 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.

Haversine formula — main illustration
Haversine formula — illustration

Key takeaways

  • Haversine formula belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Haversine formula to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Haversine formula from memory before moving on to harder problems.

Reference excerpt

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, a contraction of "half-versed sine". These names follow from the fact that they are customarily written in terms of the haversine function, given by hav θ = sin2 ⁠1/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.

The formula is contrasted with spherical law of cosines, which is theoretically equivalent, however.

Formulation The basic relation is shown by

d = r θ , {\displaystyle d=r\,\theta ,}

where

θ {\displaystyle \theta } is the central angle between any two points on a sphere,

d {\displaystyle d} is the distance between the two points along a great circle of the sphere (see spherical distance),

r {\displaystyle r} is the radius of the sphere. The haversine formula allows the haversine of θ {\displaystyle \theta } to be computed directly from the latitude (represented by φ) and longitude (represented by λ) of the two points:

hav ⁡ θ = hav ⁡ ( Δ φ ) + cos ⁡ ( φ 1 ) cos ⁡ ( φ 2 ) hav ⁡ ( Δ λ ) {\displaystyle \operatorname {hav} \theta =\operatorname {hav} \left(\Delta \varphi \right)+\cos \left(\varphi _{1}\right)\cos \left(\varphi _{2}\right)\operatorname {hav} \left(\Delta \lambda \right)}

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,

Δ φ = φ 2 − φ 1 {\displaystyle \Delta \varphi =\varphi _{2}-\varphi _{1}} , Δ λ = λ 2 − λ 1 {\displaystyle \Delta \lambda =\lambda _{2}-\lambda _{1}} . The haversine function computes half a versine of the angle θ, or the squares of half chord of the angle on a unit circle (sphere). It is related to other sinusoidal functions:

hav ⁡ θ = sin 2 ⁡ ( θ 2 ) = 1 − cos ⁡ ( θ ) 2 . {\displaystyle \operatorname {hav} \theta =\sin ^{2}\left({\frac {\theta }{2}}\right)={\frac {1-\cos(\theta )}{2}}.}

To solve for θ from the differences in latitude and longitude explicitly:

θ = 2 arcsin ⁡ ( hav ⁡ θ ) , {\displaystyle \theta =2\arcsin \left({\sqrt {\operatorname {hav} \theta }}\right),}

where hav ⁡ θ {\displaystyle \operatorname {hav} \theta } can be calculated by:

… excerpt ends here. Continue reading the full article.

Illustrations

Haversine formula: A diagram illustrating great-circle distance (drawn in red) between two points on a sphere, P and Q. Two antipodal points, u and v are also shown.
A diagram illustrating great-circle distance (drawn in red) between two points on a sphere, P and Q. Two antipodal points, u and v are also shown.
Haversine formula: Spherical triangle solved by the law of haversines
Spherical triangle solved by the law of haversines
Haversine formula: A geodesic (red) connecting Washington, D.C. to Paris, plotted on the two-point equidistant projection, with geodesic circles (blue) at multiples of 1,000 km distance from Washington.
A geodesic (red) connecting Washington, D.C. to Paris, plotted on the two-point equidistant projection, with geodesic circles (blue) at multiples of 1,000 km distance from Washington.

Worked examples

Example 1 — a first encounter with Haversine formula

Start with the simplest possible case. Write down what Haversine formula claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Haversine formula before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Haversine formula ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Haversine formula

In research
Haversine formula appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Haversine formula in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Haversine formula is common in secondary-school and first-year university syllabi. It links to neighbouring topics Distance, Geodesy, Spherical trigonometry, so understanding it makes those chapters shorter.
In everyday life
Look for Haversine formula outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Haversine formula” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Haversine formula in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Haversine formula means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Haversine formula out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Haversine formula in simple terms?

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 tr…

Why does Haversine formula matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Haversine formula?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Haversine formula.

Tags

  • Distance
  • Geodesy
  • Spherical trigonometry

Keep exploring