Search:

RHUMBSOLVE(1) GeographicLib Utilities RHUMBSOLVE(1)## NAME

RhumbSolve -- perform rhumb line calculations## SYNOPSIS

RhumbSolve[-i|-llat1lon1azi12] [-eaf] [-d|-:] [-w] [-pprec] [-s] [--comment-delimitercommentdelim] [--version|-h|--help] [--input-fileinfile|--input-stringinstring] [--line-separatorlinesep] [--output-fileoutfile]## DESCRIPTION

The path with constant heading between two points on the ellipsoid at (lat1,lon1) and (lat2,lon2) is called the rhumb line or loxodrome. Its length iss12and the rhumb line has a forward azimuthazi12along its length. Also computed isS12is the area between the rhumb line from point 1 to point 2 and the equator; i.e., it is the area, measured counter-clockwise, of the geodesic quadrilateral with corners (lat1,lon1), (0,lon1), (0,lon2), and (lat2,lon2). 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, andRhumbSolvereports NaNs for the longitude and the area in this case.NOTE:the rhumb line isnotthe shortest path between two points; that is the geodesic and it is calculated byGeodSolve(1).RhumbSolveoperates in one of three modes: 1. By default,RhumbSolveaccepts lines on the standard input containinglat1lon1azi12s12and printslat2lon2S12on standard output. This is the direct calculation. 2. Command line arguments-llat1lon1azi12specify a rhumb line.RhumbSolvethen accepts a sequence ofs12values (one per line) on standard input and printslat2lon2S12for each. This generates a sequence of points on a rhumb line. 3. With the-icommand line argument,RhumbSolveperforms the inverse calculation. It reads lines containinglat1lon1lat2lon2and prints the values ofazi12s12S12for the corresponding shortest rhumb lines. If the end points are on opposite meridians, there are two shortest rhumb lines and the east-going one is chosen.## OPTIONS

-iperform an inverse calculation (see 3 above).-lline mode (see 2 above); generate a sequence of points along the rhumb line specified bylat1lon1azi12. The-wflag can be used to swap the default order of the 2 geographic coordinates, provided that it appears before-l.-especify the ellipsoid viaaf; the equatorial radius isaand the flattening isf. Settingf= 0 results in a sphere. Specifyf< 0 for a prolate ellipsoid. A simple fraction, e.g., 1/297, is allowed forf. By default, the WGS84 ellipsoid is used,a= 6378137 m,f= 1/298.257223563.-doutput angles as degrees, minutes, seconds instead of decimal degrees.-:like-d, except use : as a separator instead of the d, ', and " delimiters.-won input and output, longitude precedes latitude (except that on input this can be overridden by a hemisphere designator,N,S,E,W).-pset the output precision toprec(default 3);precis the precision relative to 1 m. See "PRECISION".-sBy default, the rhumb line calculations are carried out exactly in terms of elliptic integrals. This includes the use of the addition theorem for elliptic integrals to compute the divided difference of the isometric and rectifying latitudes. If-sis supplied this divided difference is computed using Krueger series for the transverse Mercator projection which is only accurate for |f| < 0.01. See "ACCURACY".--comment-delimiterset the comment delimiter tocommentdelim(e.g., "#" or "//"). If set, the input lines will be scanned for this delimiter and, if found, the delimiter and the rest of the line will be removed prior to processing and subsequently appended to the output line (separated by a space).--versionprint version and exit.-hprint usage and exit.--helpprint full documentation and exit.--input-fileread input from the fileinfileinstead of from standard input; a file name of "-" stands for standard input.--input-stringread input from the stringinstringinstead of from standard input. All occurrences of the line separator character (default is a semicolon) ininstringare converted to newlines before the reading begins.--line-separatorset the line separator character tolinesep. By default this is a semicolon.--output-filewrite output to the fileoutfileinstead of to standard output; a file name of "-" stands for standard output.## INPUT

RhumbSolvemeasures all angles in degrees, all lengths (s12) in meters, and all areas (S12) in meters^2. On input angles (latitude, longitude, azimuth, arc length) can be as decimal degrees or degrees, minutes, seconds. For example, "40d30", "40d30'", "40:30", "40.5d", and 40.5 are all equivalent. By default, latitude precedes longitude for each point (the-wflag switches this convention); however on input either may be given first by appending (or prepending)NorSto the latitude andEorWto the longitude. Azimuths are measured clockwise from north; however this may be overridden withEorW. For details on the allowed formats for angles, see the "GEOGRAPHIC COORDINATES" section ofGeoConvert(1).## PRECISION

precgives precision of the output withprec= 0 giving 1 m precision,prec= 3 giving 1 mm precision, etc.precis the number of digits after the decimal point for lengths. For decimal degrees, the number of digits after the decimal point isprec+ 5. For DMS (degree, minute, seconds) output, the number of digits after the decimal point in the seconds component isprec+ 1. The minimum value ofprecis 0 and the maximum is 10.## ERRORS

An illegal line of input will print an error message to standard output beginning with "ERROR:" and causesRhumbSolveto return an exit code of 1. However, an error does not causeRhumbSolveto terminate; following lines will be converted.## ACCURACY

The algorithm used byRhumbSolveuses exact formulas for converting between the latitude, rectifying latitude (mu), and isometric latitude (psi). These formulas are accurate for any value of the flattening. The computation of rhumb lines involves the ratio (psi1-psi2) / (mu1-mu2) and this is subject to large round-off errors iflat1is close tolat2. So this ratio is computed using divided differences using one of two methods: by default, this uses the addition theorem for elliptic integrals (accurate for all values off); however, with the-soptions, it is computed using the series expansions used byTransverseMercatorProj(1) for the conversions between rectifying and conformal latitudes (accurate for |f| < 0.01). For the WGS84 ellipsoid, the error is about 10 nanometers using either method.## EXAMPLES

Route from JFK Airport to Singapore Changi Airport: echo 40:38:23N 073:46:44W 01:21:33N 103:59:22E | RhumbSolve -i -: -p 0 103:34:58.2 18523563 N.B. This isnotthe route typically taken by aircraft because it's considerably longer than the geodesic given byGeodSolve(1). Waypoints on the route at intervals of 2000km: for ((i = 0; i <= 20; i += 2)); do echo ${i}000000;done | RhumbSolve -l 40:38:23N 073:46:44W 103:34:58.2 -: -p 0 40:38:23.0N 073:46:44.0W 36:24:30.3N 051:28:26.4W 32:10:26.8N 030:20:57.3W 27:56:13.2N 010:10:54.2W 23:41:50.1N 009:12:45.5E 19:27:18.7N 027:59:22.1E 15:12:40.2N 046:17:01.1E 10:57:55.9N 064:12:52.8E 06:43:07.3N 081:53:28.8E 02:28:16.2N 099:24:54.5E 01:46:36.0S 116:52:59.7E## SEE ALSO

GeoConvert(1),GeodSolve(1),TransverseMercatorProj(1). An online version of this utility is availbable at <http://geographiclib.sourceforge.net/cgi-bin/RhumbSolve>. The Wikipedia page, Rhumb line, <https://en.wikipedia.org/wiki/Rhumb_line>.## AUTHOR

RhumbSolvewas written by Charles Karney.## HISTORY

RhumbSolvewas added to GeographicLib, <http://geographiclib.sf.net>, in version 1.37. GeographicLib 1.45 2015-09-30 RHUMBSOLVE(1)

Search: