Haversine formula

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,[1] but Florian Cajori credits an earlier use by José de Mendoza y Ríos in 1801.[2][3] The term haversine was coined in 1835 by James Inman.[4][5]

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.[6][7][8] These days, the haversine form is also convenient in that it has no coefficient in front of the sin2 function.

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.

Formulation

Let the central angle θ between any two points on a sphere be:

where

The haversine formula allows the haversine of θ 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 θ, or the squares of half chord of the angle on a unit circle (sphere).

To solve for the distance d, apply the archaversine (inverse haversine) to hav(θ) or use the arcsine (inverse sine) function:

or more explicitly:

[9]

where .

When using these formulae, one must ensure that h = hav(θ) does not exceed 1 due to a floating point error (d is real only for 0 ≤ h ≤ 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) one 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 cannot be guaranteed correct to better than 0.5%.[citation needed] 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 the 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:[10]

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 R 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 (that is, the, co-latitudes), C is the longitude separation λ2λ1, 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:

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 hav(θ), and also employ the addition identity cos(ab) = cos(a) cos(b) + sin(a) sin(b), to obtain the law of haversines, above.

Proof

One can prove the formula:

by transforming the points given by their latitude and longitude into cartesian coordinates, then taking their dot product.

Consider two points on the unit sphere, given by their latitude and longitude :

These representations are very similar to spherical coordinates, however latitude is measured as angle from the equator and not the north pole. These points have the following representations in cartesian coordinates:

From here we could directly attempt to calculate the dot product and proceed, however the formulas become significantly simpler when we consider the following fact: the distance between the two points will not change if we rotate the sphere along the z-axis. This will in effect add a constant to . Note that similar considerations do not apply to transforming the latitudes - adding a constant to the latitudes may change the distance between the points. By choosing our constant to be , and setting , our new points become:

With denoting the angle between and , we now have that:

See also

References

  1. ^ van Brummelen, Glen Robert (2013). Heavenly Mathematics: The Forgotten Art of Spherical Trigonometry. Princeton University Press. ISBN 9780691148922. 0691148929. Retrieved 2015-11-10.
  2. ^ de Mendoza y Ríos, Joseph (1795). Memoria sobre algunos métodos nuevos de calcular la longitud por las distancias lunares: y aplicacion de su teórica á la solucion de otros problemas de navegacion (in Spanish). Madrid, Spain: Imprenta Real.
  3. ^ Cajori, Florian (1952) [1929]. A History of Mathematical Notations. Vol. 2 (2 (3rd corrected printing of 1929 issue) ed.). Chicago: Open court publishing company. p. 172. ISBN 978-1-60206-714-1. 1602067147. Retrieved 2015-11-11. The haversine first appears in the tables of logarithmic versines of José de Mendoza y Rios (Madrid, 1801, also 1805, 1809), and later in a treatise on navigation of James Inman (1821). (NB. ISBN and link for reprint of second edition by Cosimo, Inc., New York, 2013.)
  4. ^ Inman, James (1835) [1821]. Navigation and Nautical Astronomy: For the Use of British Seamen (3 ed.). London, UK: W. Woodward, C. & J. Rivington. Retrieved 2015-11-09. (Fourth edition: [1].)
  5. ^ "haversine". Oxford English Dictionary (2nd ed.). Oxford University Press. 1989.
  6. ^ H. B. Goodwin, The haversine in nautical astronomy, Naval Institute Proceedings, vol. 36, no. 3 (1910), pp. 735–746: Evidently if a Table of Haversines is employed we shall be saved in the first instance the trouble of dividing the sum of the logarithms by two, and in the second place of multiplying the angle taken from the tables by the same number. This is the special advantage of the form of table first introduced by Professor Inman, of the Portsmouth Royal Navy College, nearly a century ago.
  7. ^ W. W. Sheppard and C. C. Soule, Practical navigation (World Technical Institute: Jersey City, 1922).
  8. ^ E. R. Hedrick, Logarithmic and Trigonometric Tables (Macmillan, New York, 1913).
  9. ^ Gade, Kenneth (2010). "A Non-singular Horizontal Position Representation". Journal of Navigation. 63 (3): 395–417. Bibcode:2010JNav...63..395G. doi:10.1017/S0373463309990415. ISSN 0373-4633.
  10. ^ Korn, Grandino Arthur; Korn, Theresa M. (2000) [1922]. "Appendix B: B9. Plane and Spherical Trigonometry: Formulas Expressed in Terms of the Haversine Function". Mathematical handbook for scientists and engineers: Definitions, theorems, and formulas for reference and review (3rd ed.). Mineola, New York: Dover Publications. pp. 892–893. ISBN 978-0-486-41147-7.

Further reading

Read other articles:

الوفاء العظيم (بالعربى: الوفاء العظيم)  تاريخ الصدور 6 اكتوبر 1974  البلد مصر  اللغه الاصليه اللغه المصريه الحديثه الطاقم المخرج حلمى رفله  البطوله نجلاء فتحى  السينما.كوم 1003411  تعديل  الوفاء العظيم فيلم من افلام السينما المصريه. تاريخ الوفاء العظيم اتعمل سنه...

 

Malaysia Kapitän Deen Heshaam Tan Abdullah Aktuelles ITF-Ranking 75 Statistik Erste Teilnahme 1957 Davis-Cup-Teilnahmen 51 Bestes Ergebnis Asien/Ozeanien-Gruppenzone IIHF (1992, 2000, 2001) Ewige Bilanz 41:64 Erfolgreichste Spieler Meiste Siege gesamt Si Yew-Ming (41) Meiste Einzelsiege Si Yew-Ming (27) Meiste Doppelsiege Si Yew-Ming (14) Bestes Doppel Si Yew-Ming / Selvam Veerasingam (5) Meiste Teilnahmen Si Yew-Ming (41) Meiste Jahre Selvam Veerasingam (14) Letzte Aktualisierung der Infobo...

 

هذه المقالة يتيمة إذ تصل إليها مقالات أخرى قليلة جدًا. فضلًا، ساعد بإضافة وصلة إليها في مقالات متعلقة بها. (فبراير 2022) البرنامج الوطني لتطوير قطاع الثروة الحيوانية والسمكية البرنامج الوطني لتطوير قطاع الثروة الحيوانية والسمكية‌ البلد السعودية  المقر الرئيسي الرياض  ت

Piala Negara-Negara Afrika 2004كأس أمم إفريقيا 2004Logo Piala Negara-Negara Afrika 2004Informasi turnamenTuan rumah TunisiaJadwalpenyelenggaraan24 Januari s.d. 14 Februari 2004Jumlahtim peserta16 (dari 1 konfederasi)Tempatpenyelenggaraan6 (di 6 kota)Hasil turnamenJuara Tunisia (gelar ke-1)Tempat kedua MarokoTempat ketiga NigeriaTempat keempat MaliStatistik turnamenJumlahpertandingan32Jumlah gol88 (2,75 per pertandingan)Jumlahpenonton553.500...

 

1928 film For other uses, see Easy Virtue. Easy VirtueEasy Virtue trade magazine advertDirected byAlfred HitchcockWritten byEliot StannardBased onEasy Virtueby Noël CowardProduced byUncredited:Michael BalconC. M. WoolfStarringIsabel JeansFranklin DyallEric Bransby WilliamsIan HunterCinematographyClaude L. McDonnellEdited byIvor MontaguProductioncompanyGainsborough PicturesDistributed byWoolf & Freedman Film Service (UK)Sono Art-World Wide Pictures (US)Release date 5 March 1928&...

 

Magazine written in the Esperanto language La RevuoMay 1907 edition of La RevuoEditorFélicien Menu de MénilFrequencyMonthlyPublisherHachetteFounderL. L. ZamenhofFounded1906First issueSeptember 1, 1906Final issueAugust 1914LanguageEsperanto La Revuo: Internacia monata literatura gazeto (English: The Review: An International Monthly Literature Magazine) was an Esperanto periodical, published from 1906 to 1914.[1] It was the third Esperanto periodical, following La Esperantisto (1889&#...

争取重建希腊共产党组织Οργάνωση για την Ανασυγκρότηση του ΚΚΕ Orgánosi yia tin Anasigkrótisi tou Komounistikoú Kómmatos Elládas争取重建希腊共产党组织标志簡稱OAKKE成立1985年 (1985)总部雅典意識形態共产主义政治立場极左官方色彩红色官方网站www.oakke.gr希腊政治政党 · 选举 争取重建希腊共产党组织(希腊语:Οργάνωση για την Ανασυγκρότηση του Κομο...

 

American singer and actress (born 1962) This biography of a living person needs additional citations for verification. Please help by adding reliable sources. Contentious material about living persons that is unsourced or poorly sourced must be removed immediately from the article and its talk page, especially if potentially libelous.Find sources: Taylor Dayne – news · newspapers · books · scholar · JSTOR (July 2020) (Learn how and when to remove this ...

 

Controversy concerning a genre of YouTube videos Elsagate thumbnails featured familiar children's characters doing inappropriate or disturbing things, shown directly or suggested. Examples included injections, mutilation, childbirth, urination, fellatio, and chemical burning. Elsagate was a controversy surrounding videos on YouTube and YouTube Kids that were categorized as child-friendly, but contained themes inappropriate for children. These videos often featured fictional characters from fa...

1945 film by Gregory Ratoff Paris UndergroundDirected byGregory RatoffWritten byBoris IngsterGertrude PurcellProduced byConstance BennettStarringConstance BennettGracie FieldsCinematographyLee GarmesEdward CronjagerEdited byJames E. NewcomMusic byAlexander TansmanProductioncompanyConstance Bennett ProductionsDistributed byUnited ArtistsRelease date October 19, 1945 (1945-10-19) Running time97 minutesCountryUnited StatesLanguageEnglishBudget$1 million[1] Paris Undergroun...

 

Chinese-American financial services businessman For the Chinese football player, see Zhao Peng. Peng Zhao赵鹏Peng Zhao, May 2013Born1982 or 1983 (age 40–41)[1]Beijing, China[2]Alma materUniversity of California, Berkeley (PhD)[2]Peking UniversityOccupationBusinessmanYears active2006-presentEmployerCitadel SecuritiesTitleCEO (2017-present)Board member ofThe Asian American Foundation[3]SpouseCherry Chen Peng Zhao (Chinese: ...

 

American rapper (1994–2022) TakeoffTakeoff performing at the 2017 Veld FestivalBornKirsnick Khari Ball(1994-06-18)June 18, 1994Lawrenceville, Georgia, U.S.DiedNovember 1, 2022(2022-11-01) (aged 28)Houston, Texas, U.S.Cause of deathGunshot woundsOccupationsRappersingersongwriterYears active2008–2022RelativesQuavo (uncle)Musical careerGenres Hip hop trap Labels Quality Control Motown Capitol Formerly of Migos Unc & Phew Musical artist Kirsnick Khari Ball[1][a&...

1997 single by Texas HaloSingle by Texasfrom the album White on Blonde B-sideAsking for FavoursComing DownReleased7 April 1997 (1997-04-07)[1]StudioAbbey Road (London, England)Length4:10LabelMercurySongwriter(s)Johnny McElhoneSharleen SpiteriProducer(s)TexasMike HedgesTexas singles chronology Say What You Want (1997) Halo (1997) Black Eyed Boy (1997) Alternative coversUK CD2 cover Music videoHalo on YouTube Halo is a song by Scottish alternative rock band Texas, release...

 

Japanese actor Haruo TanakaHaruo Tanaka in 1932Born(1912-03-05)March 5, 1912Kyoto, JapanDiedFebruary 21, 1992(1992-02-21) (aged 79)NationalityJapaneseOccupationFilm actor Haruo Tanaka (田中 春男, Tanaka Haruo, 5 March 1912 – 21 February 1992) was a Japanese film actor noted for his supporting roles in a career that spanned seven decades. Career Tanaka was born in Kyoto and quit school in order to become a film actor, joining the Nikkatsu studio in 1925.[1] He even...

 

Election 1848 Chicago mayoral election← 18471849 →   Nominee James H. Woodworth James Curtiss Party Independent Democrat Democratic Popular vote 1,971 1,361 Percentage 59.15% 40.85% Mayor before election James Curtiss Democratic Elected Mayor James H. Woodworth Independent Democrat Elections in Illinois Federal government U.S. Presidential elections 1820 1824 1828 1832 1836 1840 1844 1848 1852 1856 1860 1864 1868 1872 1876 1880 1884 1888 1892 1896 1900 1904 190...

2023 National Wrestling Alliance event NWA SamhainPromotional posterPromotionNational Wrestling AllianceDateOctober 28, 2023CityCleveland, OhioVenueTempleLive at Cleveland MasonicPay-per-view chronology ← Previous75th Anniversary Show Next →NWA Hard Times NWA Samhain was a professional wrestling pay-per-view event produced by the National Wrestling Alliance (NWA). It was held on October 28, 2023, at TempleLive at Cleveland Masonic in Cleveland, Ohio. Fifteen matches were contest...

 

Literature produced to explain and clarify the works of Aristotle One of Thomas Aquinas' commentaries on Aristotle. This edition dates from 1595. The page depicts Aristotle himself Commentaries on Aristotle refers to the great mass of literature produced, especially in the ancient and medieval world, to explain and clarify the works of Aristotle. The pupils of Aristotle were the first to comment on his writings, a tradition which was continued by the Peripatetic school throughout the Hellenis...

 

Town in Daegu, South KoreaDasa 다사TownKorean transcription(s) • Hangul다사읍 • Hanja多斯邑 • Revised RomanizationDasa-eup • McCune–ReischauerTasa-ŭpCountrySouth KoreaProvinceDaeguCountyDalseong CountyTown OfficeMaegok-riAdministrative divisions1 chuljangso, 11 beopjeongni, 46 hangjeongni and 551 banArea • Total36.66 km2 (14.15 sq mi)Population (2012.12) • Total62,189 • Dens...

Arid climate subtype in the Köppen climate classification system with very little precipitation Regions with desert climates   BWh (hot desert climates)   BWk (cold desert climates) The desert climate or arid climate (in the Köppen climate classification BWh and BWk) is a dry climate sub-type in which there is a severe excess of evaporation over precipitation. The typically bald, rocky, or sandy surfaces in desert climates are dry and hold little moisture, quickly evapor...

 

好気呼吸の概略図 細胞呼吸(さいぼうこきゅう、英語: Cellular respiration)または内呼吸(ないこきゅう)は、生物における呼吸の一過程で、酸素や栄養素からアデノシン三リン酸(ATP)として化学エネルギーを取り出し、老廃物を排出する生物の各細胞で起こる一連の代謝反応である[1][2]。また人間などが肺などで行う呼吸(外呼吸)とは区別されるが、以...

 

Strategi Solo vs Squad di Free Fire: Cara Menang Mudah!