The Haversine calculator computes the distance between two points on a spherical model of the Earth along a great circle arc. If you prefer to enter the Haversine calculator in Degrees, Minutes and Seconds, CLICK HERE.
INSTRUCTIONS: Enter the following:
- (Lat1) Latitude of Point 1
- (Lon1) Longitude of Point 1
- (Lat2) Latitude of Point 2
- (Lon2) Longitude of Point 2
HAVERSINE DISTANCE (D): The calculator returns the distance between the two points in kilometers and nautical miles. However, these can be automatically converted to other distance units (e.g. miles or nautical miles) via the pull-down menu. The calculator also returns the rhumb line specifications (azimuth and distance). Rhumb lines simplify navigation and provides for a constant heading (azimuth). However, the distance is slightly longer, which is also provided by the calculator.
NOTE: Use negative values for WEST longitudes and SOUTH latitudes. For example, in the map shown, Miami Florida has the coordinates (26.24628, -80.25863) for north 26.24628 degrees latitude and west 80.25863 degrees longitude.
The Math / Science
The Haversine equation is used to determine the distance between two points on the Earth based on a mean spherical earth radius. The Haversine - Distance equation is important in navigation, giving great-circle distances between two points on a sphere from their longitudes and latitudes. It is a special case of a more general formula in spherical trigonometry, the law of haversines, relating the sides and angles of spherical triangles. The first table of haversines in English was published by James Andrew in 1805. Florian Cajori credits an earlier use by Jose de Mendoza y Ríos in 1801. The term haversine was coined in 1835 by Prof. James Inman.
- D = Great Circle Arc Length (distance)
- lat 1 = latitude of first point
- lon 1 = longitude of first point
- lat 2 = latitude of second point
- lon 2 = longitude of second point
- mu_E = Mean Radius of the Earth (6371.009 km)
Sailing and Navigation Calculators:
Bruce Number: Computes the ratio of the square root of sail area to the cube root of displacement of a sail boat
- Sail Area / Displacement Ratio: Compute SA/D ratio for sail boats.
- Displacement-Length Ratio: Computes a metric to describe how heavy a boat is in relation to its waterline.
- Capsize Screening Formula: Computes a metric to describe a boat's stability in rough seas.
- Vessel Displacement Volume: Computes the cubic feet displacement associated with the weight displacement.
- Weight of Seawater: Computes the weight and mass of a volume of seawater.
- Time to Sink: Compute the time it takes for a breach (water in) to surpass the displacement of the boat.
- Haversine Distance (decimal degrees): Compute the Distance Between two Points on the Earth (Great Circle Arc)
- Haversine Distance (Degrees, Minutes and Seconds): Compute the Distance Between two Points on a Sphere (Great Circle Arc) using degrees, minutes and seconds verses decimal degrees.
- Rhumb Line Azimuth: Computes the azimuth heading one can navigate for a path that crosses all meridians of longitude at a constant angle.
- Rhumb Line Distance: Computes the distance traveled between two points on the globe if traveled via a rhumb line.
- Correction Angle:
navigation equation that compensates for air or water currents.
- Decimal Degrees: Compute decimal degree angles from degrees, minutes and seconds,[CLICK HERE].
- Nautical Travel Cost: Computes the total cost to travel a distance based on the cost rate and distance traveled.
- Travel Time between Coordinates: Compute the time to travel between two location (latitudes and longitudes) based on a average speed
- Distance to Sea Level Horizon: Computes the distance to the horizon from a specified height using a spherical model the mean spherical radius of the Earth
Flight and Navigation Calculators
- Correction Angle: Computes the navigation angle/azimuth correction angle using the wind speed, wind direction, flight heading and an Air Speed.
- Ground Speed: Computes the ground speed based on the wind speed, wind direction, a Flight Heading and an Air Speed.
- Haversine - Distance: Computes the distance between two points on a spherical model of the Earth along a great circle arc. This also includes the rhumb line distance and azimuth for the rhumb line.
- Travel Time between Coordinates: Computes the time to travel between to points on the globe in a great circle arc at an average velocity.
- Distance to Sea Level Horizon at Altitude: Computes the distance to the horizon from a specified height using a spherical model the mean spherical radius of the Earth
- Force of Drag: Calculates the resisting force of drag on an object flowing through a medium (e.g. air).
- Force of Lift: Computes the lifting force on the surface area of a wing based on the wing surface area, air flow velocity, density of air and a lift coefficient.
- Lift Coefficient: Compute the lift coefficient of a wing based on lift force, wing surface area, wind speed and density of air.
- Velocity Needed for Takeoff: Computes the velocity required to create more lift than the weight of an aircraft or watercraft using a wing (e.g. hydrofoil).
- Glide Ratio: Computes the glide ratio based on the change in forward distance and the change in altitude.
- Wing Surface Area: Computes the wing surface area required to achieve lift, base on a lift coefficient, lift force, wind speed and density of air.
- Velocity of Air over the Wing: Computes the velocity required to achieve a lift, based on lift coefficient, lift force, wing surface area and density of air.
- Air Speed from Pressures: It uses the Bernoulli Equation to estimate air speed based on the total Pressure measured by a pilot tube, total Static local atmospheric pressure and the Density of Air.
- Center of Mass: Computes the vehicle center of mass between two loads (masses).
The haversine formula
For any two points on a sphere, the haversine of the central angle between them is given by
where
- haversin is the haversine function:
- 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,
: latitude of point 1 and latitude of point 2
: longitude of point 1 and longitude of point 2
On the left side of the equals sign d/r is the central angle, assuming angles are measured in radians (note that φ and λ can be converted from degrees to radians by multiplying by π/180 as usual).
Solve for d by applying the inverse haversine (if available) or by using the arcsine (inverse sine) function:
where h is haversin(d/r), or more explicitly:
When using these formulae, ensure that h does not exceed 1 due to a floating point error (d is only real for h from 0 to 1). h only approaches 1 for antipodal points (on opposite sides of the sphere) — in this region, relatively large numerical errors tend to arise in the formula when finite precision is used. Because d is then large (approaching πR, half the circumference) a small error is often not a major concern in this unusual case (although there are other great-circle distance formulas that avoid this problem). (The formula above is sometimes written in terms of the arctangent function, but this suffers from similar numerical problems near h = 1.)
As described below, a similar formula can be written using cosines (sometimes called the spherical law of cosines, not to be confused with the law of cosines for plane geometry) instead of haversines, but if the two points are close together (e.g. a kilometer apart, on the Earth) you might end up with cos (d/R) = 0.99999999, leading to an inaccurate answer. Since the haversine formula uses sines it avoids that problem.
Either formula is only an approximation when applied to the Earth, which is not a perfect sphere: the "Earth radius" R varies from 6356.752 km at the poles to 6378.137 km at the equator. More importantly, the radius of curvature of a north-south line on the earth's surface is 1% greater at the poles (≈6399.594 km) than at the equator (≈6335.439 km)— so the haversine formula and law of cosines can't be guaranteed correct to better than 0.5%. More accurate methods that consider the Earth's ellipticity are given by Vincenty's formulae and the other formulas in the geographical distance article.
The law of haversines
Spherical triangle solved by law of haversines.
Given a unit sphere, a "triangle" on the surface of the sphere is defined by the great circles connecting three points u, v, and w on the sphere. If the lengths of these three sides are a (from u to v), b (from u to w), and c (from v to w), and the angle of the corner opposite c is C, then the law of haversines states:
(the law of haversines)
Since this is a unit sphere, the lengths a, b, and c are simply equal to the angles (in radians) subtended by those sides from the center of the sphere (for a non-unit sphere, each of these arc lengths is equal to its central angle multiplied by the radius of the sphere).
In order to obtain the haversine formula of the previous section from this law, one simply considers the special case where u is the north pole, while v and w are the two points whose separation d is to be determined. In that case, a and b are π/2 − φ1,2 (i.e., 90° − latitude), C is the longitude separation Δλ, and c is the desired d/R. Noting that sin(π/2 − φ) = cos(φ), the haversine formula immediately follows.
To derive the law of haversines, one starts with the spherical law of cosines:
(spherical law of cosines)
As mentioned above, this formula is an ill-conditioned way of solving for c when c is small. Instead, we substitute the identity that cos(θ) = 1 − 2 haversin(θ), and also employ the addition identity cos(a − b) = cos(a) cos(b) + sin(a) sin(b), to obtain the law of haversines, above.
Great Circle Calculators
- Compute decimal degree angles from degrees, minutes and seconds,CLICK HERE.
- Compute the time to travel between two latitudes and longitudes
- Compute the Distance Between two Points on a Sphere (Great Circle Arc)
- Compute the Great Circle Arc Central Angle
- Great Circle Arc Angle (Vincenty's)
References
- wikipedia - http://en.wikipedia.org/wiki/Haversine_formula