#! /bin/sh
#
# RhumbSolve.cgi
# cgi script for rhumb line calculations
#
# Copyright (c) Charles Karney (2014-2022)
Online rhumb line calculations using the
RhumbSolve utility
Input (ex. «40.6 -73.8 49°01'N 2°33'E»
[inverse],
«40d38'23"N 073d46'44"W 53d30' 5850e3»
[direct]):
| Output format: | EOF while read c desc; do CHECKED= test "$c" = "$FORMAT" && CHECKED=CHECKED echo "" echo " | " done <||||||||
| Output precision: | |||||||||
| Equatorial radius: | meters | ||||||||
| Flattening: | |||||||||
Select action:
Rhumb Line (input in black, output in ${F}blue${G}):
ellipsoid (a f) = `encodevalue "$RADIUS"` `encodevalue "$FLATTENING"`$TAG
status = `encodevalue "$STATUS"`
lat1 lon1 (°) = $POSITION1
lat2 lon2 (°) = $POSITION2
azi12 (°) = $AZIMUTH
s12 (m) = $DIST12
S12 (m^2) = $F$S12$G
RhumbSolve (version $VERSION) performs rhumb line calculations for an arbitrary ellipsoid of revolution. The path with a constant heading between two points on the ellipsoid at (lat1, lon1) and (lat2, lon2) is called the rhumb line (or loxodrome); its length is s12 and the rhumb line has a forward azimuth azi12 along its length. NOTE: the rhumb line is not the shortest path between two points; that is the geodesic and it is calculated by GeodSolve.
There are two standard rhumb line problems:
16.776 -3.009
16d47' -3d1'
W3°0'34" N16°46'33"
3:0:34W 16:46:33N
Azimuths are given in degrees clockwise from north. The
distance s12 is in meters.
The additional quantity computed is:
A point at a pole is treated as a point a tiny distance away from the pole on the given line of longitude. The longitude becomes indeterminate when a rhumb line passes through a pole, and RhumbSolve reports NaNs for the longitude and the area in this case.
The ellipsoid is specified by its equatorial radius, a, and its flattening, f = (a − b)/a, where b is the polar semi-axis. The default values for these parameters correspond to the WGS84 ellipsoid. The method is accurate for −99 ≤ f ≤ 0.99 (corresponding to 0.01 ≤ b/a ≤ 100). Note that f is negative for a prolate ellipsoid (b > a) and that it can be entered as a fraction, e.g., 1/297.
RhumbSolve is accurate to about 15 nanometers (for the WGS84 ellipsoid) and gives solutions for the inverse problem for any pair of points. The longitude becomes indeterminate when a rhumb line passes through a pole, and this tool reports NaNs (not a number) for lon2 and S12 in this case.
RhumbSolve, which is a simple wrapper of the GeographicLib::Rhumb class, is one of the utilities provided with GeographicLib. See also the section of the GeographicLib documentation on Rhumb lines and the Wikipedia page, Rhumb line.