1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
|
int usage(int retval, bool brief) {
if (brief)
( retval ? std::cerr : std::cout ) << "Usage:\n"
" RhumbSolve [ -i | -l lat1 lon1 azi12 ] [ -e a f ] [ -d | -: ] [ -f ] [\n"
" -p prec ] [ -s ] [ --comment-delimiter commentdelim ] [ --version | -h\n"
" | --help ] [ --input-file infile | --input-string instring ] [\n"
" --line-separator linesep ] [ --output-file outfile ]\n"
"\n"
"For full documentation type:\n"
" RhumbSolve --help\n"
"or visit:\n"
" http://geographiclib.sf.net/1.37/RhumbSolve.1.html\n";
else
( retval ? std::cerr : std::cout ) << "Man page:\n"
"NAME\n"
" RhumbSolve -- perform rhumb line calculations\n"
"\n"
"SYNOPSIS\n"
" RhumbSolve [ -i | -l lat1 lon1 azi12 ] [ -e a f ] [ -d | -: ] [ -f ] [\n"
" -p prec ] [ -s ] [ --comment-delimiter commentdelim ] [ --version | -h\n"
" | --help ] [ --input-file infile | --input-string instring ] [\n"
" --line-separator linesep ] [ --output-file outfile ]\n"
"\n"
"DESCRIPTION\n"
" The path with constant heading between two points on the ellipsoid at\n"
" (lat1, lon1) and (lat2, lon2) is called the rhumb line or loxodrome.\n"
" Its length is s12 and the rhumb line has a forward azimuth azi12 along\n"
" its length. A point at a pole is treated as a point a tiny distance\n"
" away from the pole on the given line of longitude. The longitude\n"
" becomes indeterminate when a rhumb line passes through a pole, and\n"
" RhumbSolve reports NaNs for the longitude in this case.\n"
"\n"
" NOTE: the rhumb line is not the shortest path between two points; that\n"
" is the geodesic and it is calculated by GeodSolve(1).\n"
"\n"
" RhumbSolve operates in one of three modes:\n"
"\n"
" 1. By default, RhumbSolve accepts lines on the standard input\n"
" containing lat1 lon1 azi12 s12 and prints lat2 lon2 on standard\n"
" output. This is the direct calculation.\n"
"\n"
" 2. Command line arguments -l lat1 lon1 azi12 specify a rhumb line.\n"
" RhumbSolve then accepts a sequence of s12 values (one per line) on\n"
" standard input and prints lat2 lon2 for each. This generates a\n"
" sequence of points on a rhumb line.\n"
"\n"
" 3. With the -i command line argument, RhumbSolve performs the inverse\n"
" calculation. It reads lines containing lat1 lon1 lat2 lon2 and\n"
" prints the values of azi12 s12 for the corresponding shortest rhumb\n"
" lines\n"
"\n"
"OPTIONS\n"
" -i perform an inverse calculation (see 3 above).\n"
"\n"
" -l line mode (see 2 above); generate a sequence of points along the\n"
" rhumb line specified by lat1 lon1 azi12.\n"
"\n"
" -e specify the ellipsoid via a f; the equatorial radius is a and the\n"
" flattening is f. Setting f = 0 results in a sphere. Specify f < 0\n"
" for a prolate ellipsoid. A simple fraction, e.g., 1/297, is\n"
" allowed for f. (Also, if f > 1, the flattening is set to 1/f.) By\n"
" default, the WGS84 ellipsoid is used, a = 6378137 m, f =\n"
" 1/298.257223563.\n"
"\n"
" -d output angles as degrees, minutes, seconds instead of decimal\n"
" degrees.\n"
"\n"
" -: like -d, except use : as a separator instead of the d, ', and \"\n"
" delimiters.\n"
"\n"
" -p set the output precision to prec (default 3); prec is the precision\n"
" relative to 1 m. See \"PRECISION\".\n"
"\n"
" -s By default, the rhumb line calculations are carried out exactly in\n"
" terms of elliptic integrals. This includes the use of the addition\n"
" theorem for elliptic integrals to compute the divided difference of\n"
" the isometric and rectifying latitudes. If -s is supplied this\n"
" divided difference is computed using Krueger series for the\n"
" transverse Mercator projection which is only accurate for |f| <\n"
" 0.01. See \"ACCURACY\".\n"
"\n"
" --comment-delimiter\n"
" set the comment delimiter to commentdelim (e.g., \"#\" or \"//\"). If\n"
" set, the input lines will be scanned for this delimiter and, if\n"
" found, the delimiter and the rest of the line will be removed prior\n"
" to processing and subsequently appended to the output line\n"
" (separated by a space).\n"
"\n"
" --version\n"
" print version and exit.\n"
"\n"
" -h print usage and exit.\n"
"\n"
" --help\n"
" print full documentation and exit.\n"
"\n"
" --input-file\n"
" read input from the file infile instead of from standard input; a\n"
" file name of \"-\" stands for standard input.\n"
"\n"
" --input-string\n"
" read input from the string instring instead of from standard input.\n"
" All occurrences of the line separator character (default is a\n"
" semicolon) in instring are converted to newlines before the reading\n"
" begins.\n"
"\n"
" --line-separator\n"
" set the line separator character to linesep. By default this is a\n"
" semicolon.\n"
"\n"
" --output-file\n"
" write output to the file outfile instead of to standard output; a\n"
" file name of \"-\" stands for standard output.\n"
"\n"
"INPUT\n"
" RhumbSolve measures all angles in degrees and all lengths (s12) in\n"
" meters. On input angles (latitude, longitude, azimuth) can be as\n"
" decimal degrees or degrees (d), minutes ('), seconds (\"). A decimal\n"
" point can only appear in the least significant component and the\n"
" designator (d, ', or \") for this component is optional; thus \"40d30\",\n"
" \"40d30'\", \"40.5d\", and 40.5 are all equivalent. By default, latitude\n"
" precedes longitude for each point; however on input either may be given\n"
" first by appending (or prepending) N or S to the latitude and E or W to\n"
" the longitude. Azimuths are measured clockwise from north; however\n"
" this may be overridden with E or W.\n"
"\n"
" See the \"QUOTING\" section of GeoConvert(1) for how to quote the DMS\n"
" designators ' and \".\n"
"\n"
"PRECISION\n"
" prec gives precision of the output with prec = 0 giving 1 m precision,\n"
" prec = 3 giving 1 mm precision, etc. prec is the number of digits\n"
" after the decimal point for lengths. For decimal degrees, the number\n"
" of digits after the decimal point is prec + 5. For DMS (degree,\n"
" minute, seconds) output, the number of digits after the decimal point\n"
" in the seconds component is prec + 1. The minimum value of prec is 0\n"
" and the maximum is 10.\n"
"\n"
"ERRORS\n"
" An illegal line of input will print an error message to standard output\n"
" beginning with \"ERROR:\" and causes RhumbSolve to return an exit code of\n"
" 1. However, an error does not cause RhumbSolve to terminate; following\n"
" lines will be converted.\n"
"\n"
"ACCURACY\n"
" The algorithm used by RhumbSolve uses exact formulas for converting\n"
" between the latitude, rectifying latitude (mu), and isometric latitude\n"
" (psi). These formulas are accurate for any value of the flattening.\n"
" The computation of rhumb lines involves the ratio (psi1 - psi2) / (mu1\n"
" - mu2) and this is subject to large round-off errors if lat1 is close\n"
" to lat2. So this ratio is computed using divided differences using one\n"
" of two methods: by default, this uses the addition theorem for elliptic\n"
" integrals (accurate for all values of f); however, with the -s options,\n"
" it is computed using the series expansions used by\n"
" TransverseMercatorProj(1) for the conversions between rectifying and\n"
" conformal latitudes (accurate for |f| < 0.01). For the WGS84\n"
" ellipsoid, the error is about 10 nanometers using either method.\n"
"\n"
"EXAMPLES\n"
" Route from JFK Airport to Singapore Changi Airport:\n"
"\n"
" echo 40:38:23N 073:46:44W 01:21:33N 103:59:22E |\n"
" RhumbSolve -i -: -p 0\n"
"\n"
" 103:34:58.2 18523563\n"
"\n"
" N.B. This is not the route typically taken by aircraft because it's\n"
" considerably longer than the geodesic given by GeodSolve(1).\n"
"\n"
" Waypoints on the route at intervals of 2000km:\n"
"\n"
" for ((i = 0; i <= 20; i += 2)); do echo ${i}000000;done |\n"
" RhumbSolve -l 40:38:23N 073:46:44W 103:34:58.2 -: -p 0\n"
"\n"
" 40:38:23.0N 073:46:44.0W\n"
" 36:24:30.3N 051:28:26.4W\n"
" 32:10:26.8N 030:20:57.3W\n"
" 27:56:13.2N 010:10:54.2W\n"
" 23:41:50.1N 009:12:45.5E\n"
" 19:27:18.7N 027:59:22.1E\n"
" 15:12:40.2N 046:17:01.1E\n"
" 10:57:55.9N 064:12:52.8E\n"
" 06:43:07.3N 081:53:28.8E\n"
" 02:28:16.2N 099:24:54.5E\n"
" 01:46:36.0S 116:52:59.7E\n"
"\n"
"SEE ALSO\n"
" GeoConvert(1), GeodSolve(1), TransverseMercatorProj(1).\n"
"\n"
"AUTHOR\n"
" RhumbSolve was written by Charles Karney.\n"
"\n"
"HISTORY\n"
" RhumbSolve was added to GeographicLib, <http://geographiclib.sf.net>,\n"
" in version 1.37.\n"
;
return retval;
}
|