navlib.py provides the user with several functions to allow spherical geometry calculations.

The units are decimal degrees for latitude and longitude. Latitude is positive if North, negative if South. Longitude is positive if East, negative if West.

Distances are in nautical miles (equivalent to a minute of arc on a great circle).

The functions provided are:

    OrthoDist(lat1, lon1, lat2, lon2)
        Calculates the distance, in nautical miles, along the great circle between two points on the globe

    OrthoHead(lat1, lon1, lat2, lon2)
        Calculates the bearing of point2 (lat2, lon2) as seen from point1 (lat1, lon1) along the great circle passing through both points

    OrthoStep(lat, lon, heading, distance)
        Calculates the latitude and longitude of the destination given the initial point latitude and longitude, the initial heading and the distance travelled.
        The path travelled being a great circle.

    LoxoDist(lat1, lon1, lat2, lon2)
        Calculates the loxodromic (rhumb line) distance between two points on the globe.

    LoxoHead(lat1, lon1, lat2, lon2)
        Calculates the loxodromic bearing of point2 (lat2, lon2) seen from point1 (lat1, lon1). This is the rhumb line heading.

    LoxoStep(lat, lon, heading, distance)
         Calculates the latitude and longitude of the destination given the initial point latitude and longitude, the heading and the distance travelled.
         The path travelled being a loxodrome (rhumb line).
         Note that unlike on a great circle where the distance can be infinite, merely going around the globe several times, a loxodrome has a finite length.
         Specifying a length too large will raise an ExcessLengthError exception.

Another exception which may occur is LatitudeError which is raised if a latitude is not between -90 and +90 degrees.