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:

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

 

FM

FM/Live Anuncio comercial del álbum en BillboardÁlbum en vivo de Climax Blues BandPublicación noviembre de 1973Recinto musical Academy of Music(Nueva York, Nueva York)Género(s) RockDiscográfica SireCatálogo SAS-2-7411Productor(es) Richard Gottehrer Cronología de Climax Blues Band Rich Man (1972) FM/Live (1973) Sense of Direction (1974) [editar datos en Wikidata] FM/Live es un álbum en vivo doble de la banda británica Climax Blues Band, publicado en noviembre de 1973 por Sir...

 

De FDGB-Pokal 1987–1988 was de 37ste editie van de strijd om de Oost-Duitse voetbalbeker. De beker werd voor de tweede keer in de clubgeschiedenis gewonnen door BFC Dynamo, dat in de finale met 2-0 won van FC Carl Zeiss Jena. Schema kwartfinale halve finale finale                                                    BSG Bischofswerda  0  BFC Dynamo  ...

Schloss Randegg Das Schloss Randegg ist ein Schloss in Randegg, einem Ortsteil von Gottmadingen im baden-württembergischen Landkreis Konstanz. Inhaltsverzeichnis 1 Geschichte 2 Anlage 3 Literatur 4 Weblinks Geschichte Eine erste Burg wurde vermutlich im 12. Jahrhundert (oder noch früher) erbaut. Es ist sogar möglich, dass sich an dieser Stelle ein römisches Kastell befand und die Burg auf deren Grundmauern erbaut wurde. Die Burg ist im Jahre 1214 zum ersten Mal urkundlich erwähnt und war...

 

Sexy Cat no Enzetsu / Mukidashi de Mukiatte / Sō ja NaiLagu oleh Morning MusumeDirilis23 November 2016 (2016-11-23) (Jepang)FormatCD single, DVDGenreJ-pop, electronica, diskoDurasi26:58LabelZetimaProduserTsunkuVideo musikSexy Cat no Enzetsu di YouTubeVideo musikMukidashi de MukiatteVideo musikSō ja Nai Sexy Cat no Enzetsu / Mukidashi de Mukiatte / Sō ja Nai (セクシーキャットの演説/ムキダシで向き合って/そうじゃないcode: ja is deprecated )[1] adala...

 

Perang saudara Kerajaan MunaIlustrasi Perang saudara Kerajaan Muna.Tanggal1700-an – 1816LokasiPulau MunaHasil Kemenangan Wa Ode KadingkePihak terlibat Kerajaan Muna (Wa Ode Kadingke) Kesultanan Buton Kerajaan Tiworo Kerajaan Muna (La Ode Sumaeli)Tokoh dan pemimpin Wa Ode Kadingke Daeng Marewa La Kopuru (Sultan Buton) La Ode SumaeliKekuatan Tidak diketahui Tidak diketahuiKorban Tidak diketahui Tidak diketahui Perang saudara Kerajaan Muna adalah perang saudara yang terjadi pada akhir tahun 17...

西班牙廣場,右前方的黃白色建築曾經是詩人約翰·濟慈的住所 西班牙廣場(義大利語:Piazza di Spagna)是位于義大利羅馬的廣場,旁有羅馬地鐵的同名車站。山上天主圣三堂(由法國波旁王朝的國王所資助建造)就位在與西班牙廣場相接的西班牙階梯頂端。西班牙廣場也曾經出現在電影《羅馬假期》的場景中。 設計 西班牙廣場上有一個巴洛克藝術的噴泉,被稱為破船噴泉...

 

إلين تيري إلين تيري وهي بعمر 16 سنة معلومات شخصية اسم الولادة أليس إلين تيري الميلاد 27 فبراير 1847(1847-02-27)مدينة كوفنتري، إنجلترا الوفاة 21 يوليو 1928 (81 سنة)قرية هايث الصغيرة، مقاطعة كنت، إنجلترا سبب الوفاة سكتة دماغية  مواطنة المملكة المتحدة  الزوج جورج فريدريك واتس (20 فبراي...

 

Artikel ini tidak memiliki referensi atau sumber tepercaya sehingga isinya tidak bisa dipastikan. Tolong bantu perbaiki artikel ini dengan menambahkan referensi yang layak. Tulisan tanpa sumber dapat dipertanyakan dan dihapus sewaktu-waktu.Cari sumber: Tumbuhan runjung – berita · surat kabar · buku · cendekiawan · JSTOR Tumbuhan runjung (Pinophyta) Periode Karbon – Sekarang PreЄ Є O S D C P T J K Pg N Pinophyta TaksonomiSuperdomainBiotaSuperkerajaa...

1999 fighting video game 1999 video gameTekken Tag TournamentPlaystation 2 cover artDeveloper(s)NamcoPublisher(s)Namco[a]Director(s)Masahiro KimotoKatsuhiro HaradaYuichi YonemoriProducer(s)Yasuhiro NoguchiComposer(s)Akitaka TohyamaYuu MiyakeNobuyoshi SanoKeiichi OkabeSeriesTekkenPlatform(s)Arcade, PlayStation 2ReleaseArcadeJP: July 1999[1]WW: 1999PlayStation 2JP: March 30, 2000NA: October 26, 2000EU: November 24, 2000Genre(s)FightingMode(s)Single-player, multiplayerArcade syst...

 

American racing driver NASCAR driver Johanna RobbinsBornJohanna Long (1992-05-26) May 26, 1992 (age 31)Pensacola, Florida, U.S.Achievements2010 Snowball Derby winnerNASCAR Xfinity Series career42 races run over 3 years2015 position72ndBest finish20th (2012)First race2012 DRIVE4COPD 300 (Daytona)Last race2015 U.S. Cellular 250 (Iowa) Wins Top tens Poles 0 0 0 NASCAR Craftsman Truck Series career24 races run over 2 yearsBest finish21st (2011)First race2010 AAA Insurance 200 (IRP)Last race2...

 

2008 Indian filmPhoonkTheatrical release posterDirected byRam Gopal VarmaWritten byMilind GadagkarProduced byPraveen Nischol NischolAzam KhanParvez DamaniaStarringSudeepAmruta KhanvilkarAhsaas ChannaKenny DesaiAshwini KalsekarZakir HussainCinematographySavita SinghEdited byAmit ParmarNipun GuptaRelease date August 22, 2008 (2008-08-22) (India) Running time110 minutesCountryIndiaLanguageHindiBox office₹60 crore Phoonk (transl. Blow) is a 2008 Indian supernatural horror fil...

Rue en banlieue de Berlin après la Seconde Guerre mondiale : des personnes déplacées, avec leurs biens entassés dans des chariots et des landaus. À l'issue de la Seconde Guerre mondiale, des camps de personnes déplacées en Europe sont ouverts en Allemagne, en Autriche et en Italie. Ils sont principalement destinés aux réfugiés venus d'Europe de l'Est et aux anciens prisonniers des camps de concentration du Troisième Reich. Un « camp de personnes déplacées » est u...

 

1943 painting series by Norman Rockwell Four FreedomsFreedom of SpeechFreedom of WorshipFreedom from WantFreedom from FearFour canvas series displayed by date of publicationArtistNorman RockwellYear1943MediumOil on canvasDimensionsEach ≅ 45.75 by 35.5 inches (116.2 by 90.2 cm)LocationNorman Rockwell Museum, Stockbridge, Massachusetts, United States The Four Freedoms is a series of four oil paintings made in 1943 by the American artist Norman Rockwell. The paintings—Freedom of Speech,...

 

Human settlement in EnglandPophamPophamLocation within HampshireDistrictBasingstoke and DeaneShire countyHampshireRegionSouth EastCountryEnglandSovereign stateUnited KingdomPost townWinchesterPostcode districtSO21Dialling code01256PoliceHampshire and Isle of WightFireHampshire and Isle of WightAmbulanceSouth Central UK ParliamentWinchester List of places UK England Hampshire 51°11′23″N 1°12′03″W / 51.1896°N 1.2009°W / 51.1896; -1.20...

Masacre de Isla Vista de 2014 Ubicación de Isla Vista, en California.Lugar Isla Vista, California, Estados UnidosCoordenadas 34°24′43″N 119°51′32″O / 34.412, -119.859Blanco(s) Estudiantes de UCSBFecha 23 de mayo de 2014Tipo de ataque Apuñalamiento, tiroteo, asalto vehicular, asesinato-suicidioArma(s) CuchilloPistola Glock 34SIG Sauer P226 (2)BMW 328iMuertos 7 (incluyendo el perpetrador)Heridos 13 (8 por armas de fuego, 4 por traumatismos, 1 incierto)Perpetrador(es)...

 

Japanese statesman (1830-1878) You can help expand this article with text translated from the corresponding article in Japanese. (June 2014) Click [show] for important translation instructions. View a machine-translated version of the Japanese article. Machine translation, like DeepL or Google Translate, is a useful starting point for translations, but translators must revise errors as necessary and confirm that the translation is accurate, rather than simply copy-pasting machine-transla...

 

Danielle Scott Nazionalità  Australia Altezza 167 cm Peso 57 kg Freestyle Specialità Salti Palmarès Competizione Ori Argenti Bronzi Mondiali 0 2 1 Trofeo Vittorie Coppa del Mondo di salti 1 trofeo Per maggiori dettagli vedi qui Statistiche aggiornate al 3 dicembre 2023 Modifica dati su Wikidata · Manuale Danielle Scott (Sydney, 7 marzo 1990) è una sciatrice freestyle australiana, specialista dei salti. Indice 1 Biografia 2 Palmarès 2.1 Mondiali 2.2 Coppa del Mondo 2.2.1 Co...

Капская винная змея Научная классификация Домен:ЭукариотыЦарство:ЖивотныеПодцарство:ЭуметазоиБез ранга:Двусторонне-симметричныеБез ранга:ВторичноротыеТип:ХордовыеПодтип:ПозвоночныеИнфратип:ЧелюстноротыеНадкласс:ЧетвероногиеКлада:АмниотыКлада:ЗавропсидыКласс:...

 

Boża Wola wieś Państwo  Polska Województwo  małopolskie Powiat olkuski Gmina Wolbrom Liczba ludności (2022) 141[2] Strefa numeracyjna 32 Kod pocztowy 32-340[3] Tablice rejestracyjne KOL SIMC 0223651 Położenie na mapie gminy WolbromBoża Wola Położenie na mapie PolskiBoża Wola Położenie na mapie województwa małopolskiegoBoża Wola Położenie na mapie powiatu olkuskiegoBoża Wola 50°25′10″N 19°47′50″E/50,419444 19,797222[1] Boża Wola – wie...

 

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