Haversine Navigation
(HavNav)

Abstract

This is to provide a practical means for cruise planning using either the computer spreadsheet, the hand held calculator, or applications (apps) available for the iPhone or iPad.

Background

Shortly after achieving the grade of Navigator with the Shrewsbury River Power Squadron in April of 1962, I took an active interest in the mathematics of sight reduction that went beyond the methods of HO 211 and HO 214. Preferring analytic over graphic voyage planning provided the motive for these studies. Please remember that this was done before the computer, GPS, and even the most basic hand held calculator. Today using data (waypoint information) from a Cruising Guide, it is easier and faster to plan with the computer.

The spherical trigonometry equations taught left an ambiguity when the initial course was close to due east or west. Further solutions using the Spherical Law of Cosines fall apart when the distances are very small; short distances are most important to the vast majority of weekend sailors. Haversines resolved these issues. Today there are dozens of websites that will give you the course and distance between two points on the earth given the Latitude and Longitude of each. Many of these sites report the distance in kilometers which require a definition of the radius of the earth. The haversine method herein described uses a unit radius; thus, a distance as an angle readily resolves to nautical miles; therefore, I am going to limit this to a simple definition of the haversine and practical topics for cruise planning with the spreadsheet on the computer and to solutions on the handheld calculator as well as on the iPhone and iPad.

The Haversine

The haversine is half a versed sine. The versed sine appeared in early trig tables but is no longer used. The versed sine or versine is 1 – cosine (Θ). Thus by definition

     Haversine (Θ) = sin2 (Θ/2) = (1 – cosine (Θ)) / 2

Now we will apply this to our spherical trig application to determine the course and distance between two points.

Haversine Equations for Spherical Navigation

D = acos(1 – 2 * havD), where

     havD = hav(CoLA - CoLB) + SinCoLA * SinCoLB * havDLo

C = acos(1 – 2 * havC), where

     havC = (havCoLB - hav(CoLA - D)) / (sinCoLA * sinD)

Assumptions & Notes

The earth is a perfect sphere. This is accurate for the purpose of cruise planning within a reasonable area, e.g. Bahamas or Eastern Caribbean.

Neglecting the fact that the earth is an oblate spheroidal can result in errors of typically less than 0.5%; this is not significant for our purposes.

The spreadsheet and handheld calculator implementations shown here are valid only for the northwestern quadrasphere.1

Haversine methodology will give errors when approaching antipodal points (on opposite sides of the earth); this is of minor consideration to the practical sailor.

Implementations

1 Spreadsheet

The Microsoft Excel workbook HaversineNavigation.xlsx consists of several worksheets:

  • BB Navigation – This is the example using a portion of the Bowditch Bay chart featuring a fictitious April Fool’s Day race both clockwise and counterclockwise around a set of four waypoints. (See Figures I & II)
  • BBdata - This feed contains the waypoint data for the preceding worksheet. Items in the waypoint column are to be sorted alphabetically from A-Z; waypoint names must contain no spaces. (See Figure III)
  • HaversinePlot – Worksheet to show that the haversine function is continuous over the range from 00 through 1800. (See Figure IV)
  • MI Navigation - This worksheet and the one below are for trip planning in and about the Merritt Island area.
  • MIdata – Contains several user defined waypoints including those used recently for sailboat racing.
  • VI Navigation - This worksheet and the one below are for trip planning in and about the British Virgin Islands.
  • HavNavHP 15C -
  • Conversion - this worksheet and the following one were used for data conversion while planning a cruise in and about the British Virgin Islands.
  • MapTechData
Figure I, Haversine Navigation Example, Bowditch Bay April Fool’s Day Race

Figure I, Haversine Navigation Example, Bowditch Bay April Fool’s Day Race

The magnetic courses for this fictitious race, both clockwise and counterclockwise were calculated using the workbook. Figure II shows the part of the worksheet BB Navigation that was used to create the counterclockwise courses. The distances between waypoints were also calculated in this worksheet.

The first step in cruise planning is to populate the data worksheet with your waypoints, their description, and their latitude and longitude. The navigation worksheet requires that latitude and longitude be supplied in format DD.dddd. You may choose to enter them directly into columns C and D in that format or use column C through H to aid you.

Once your data worksheet is populated you may now proceed to the navigation sheet where you enter your waypoints in rows one and two along with the magnetic variation in row 12. As you enter this data into the white spaces results will show immediately in the yellow shaded areas; the gray areas are for intermediate calculations. Once you have downloaded your HaversineNavigation.xlsx workbook you may explore it to see what is calculated in each cell and the formulae used.

Figure II

Figure II, Part of Worksheet BB Navigation

Figure III

Figure III, Worksheet BBdata

Figure IV

Figure IV, Figure IV, Plot of Sine, Cosine, & Haversine (00 to 3600)

2 Calculator

The equations shown earlier are easily implemented into any handheld calculator with memory storage. I have chosen to show an application using the HP 15C calculator that uses RPN (Figure VI). This particular device has an app for use on Android Devices, or the iPhone and iPad.2

You only have to program your device once. The RPN programming steps are shown in Figure V.3

After programming, enter the latitude and longitude for the first waypoint into registers 5 and 6 in the DD.dddd format. Follow this with the latitude and longitude for the second waypoint into registers 8 & 9.

Enter the magnetic variation for the area into register 0. Press label A (f LBL A) to return the initial true course into register 2 and the distance nautical miles into register 3. They will also be in the X and Y registers respectively.

HP 15C Front HP 15C Back

Figure V, HP 15C as seen on Android devices, the iPad, or iPhone

Press label B (f LBL B) to return the initial magnetic course into register 1. It will also be in the X register at this time.

Haversine navigation with the calculator is more cumbersome and slower than the Excel workbook method; however, when it is available on your cell phone it makes up for these deficiencies with its convenience.

HP 15C Back

Figure VI, View of the HavNav worksheet with programming steps and instructions4

Definitions/Abbreviations/Acronyms

ahav
ArcHaversine (angle whose haversine is.. .)
Cos
Cosine
DLo
Difference in Longitude
Hav
Haversine
LA
Latitude Point A
LB
Latitude Point B
LoA
Longitude Point A
LoB
Longitude Point B
RPN
Reverse Polish Notation
Sin
Sine

Websites of interest:

References

Bowditch (1958 edition)

  • Index for the Haversine:
  • Table 34 contains 56 pages 5 degrees per page of LogHav & NatHav
    • defined p929 - p1032
    • table 34 p1421 - p1456
    • explained p1197p
  • Paragraph 822 p232
  • Paragraph 2109 p528

End Notes

  1. A measure of land that is one fourth part of the world
  2. Interestingly it is easier to use on an iPad then it is on the actual calculator as the keypad is large.
  3. They may be more easily seen in worksheet HavNavHP 15C once you have downloaded the workbook HaversineNavigation.xlsx.
  4. Complementing an angle takes less programming steps with the Sin aCos method than subtracting the angle from 90°.
  5. Reports of the demise of the HP 15C are highly exaggerated; HP has brought it back as the result of customer demand
  6. Cumbersome to use but with good reading below the calculations
  7. Printed tables of haversines, arc haversines, and their logarithms aided navigators in the days prior to the modern digital calculator and computer. Fifty-six pages of Bowditch have been replaced by the iPhone.