.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "GEOD3SOLVE 1" .TH GEOD3SOLVE 1 2025-11-05 "GeographicLib 2.7" "GeographicLib Utilities" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Geod3Solve \-\- perform geodesic calculations on a triaxial ellipsoid .SH SYNOPSIS .IX Header "SYNOPSIS" \&\fBGeod3Solve\fR [ \fB\-i\fR | \fB\-L\fR \fIbet1\fR \fIomg1\fR \fIalp1\fR ] [ \fB\-t\fR \fIa\fR \fIb\fR \fIc\fR | \fB\-e\fR \fIb\fR \fIe2\fR \fIk2\fR \fIkp2\fR | \&\fB\-e2\fR \fIb\fR \fIf\fR ] [ \fB\-u\fR ] [ \fB\-d\fR | \fB\-:\fR ] [ \fB\-w\fR ] [ \fB\-f\fR ] [ \fB\-p\fR \fIprec\fR ] [ \fB\-\-comment\-delimiter\fR \fIcommentdelim\fR ] [ \fB\-\-version\fR | \fB\-h\fR | \fB\-\-help\fR ] [ \fB\-\-input\-file\fR \fIinfile\fR | \fB\-\-input\-string\fR \fIinstring\fR ] [ \fB\-\-line\-separator\fR \fIlinesep\fR ] [ \fB\-\-output\-file\fR \fIoutfile\fR ] .SH DESCRIPTION .IX Header "DESCRIPTION" The shortest path between two points on a triaxial ellipsoid at (\fIbet1\fR, \fIomg1\fR) and (\fIbet2\fR, \fIomg2\fR) is called the geodesic. Its length is \fIs12\fR and the geodesic from point 1 to point 2 has forward azimuths \fIalp1\fR and \fIalp2\fR at the two end points. Here \fIbet\fR and \&\fIomg\fR denote the ellipsoidal latitude, \fIbeta\fR, and longitude, \&\fIomega\fR; \fIalp\fR is an abbreviation of \fIalpha\fR .PP \&\fBGeod3Solve\fR operates in one of three modes: .IP 1. 4 By default, \fBGeod3Solve\fR accepts lines on the standard input containing \&\fIbet1\fR \fIomg1\fR \fIalp1\fR \fIs12\fR and prints \fIbet2\fR \fIomg2\fR \fIalp2\fR on standard output. This is the direct geodesic calculation. .IP 2. 4 With the \fB\-i\fR option, \fBGeod3Solve\fR performs the inverse geodesic calculation. It reads lines containing \fIbet1\fR \fIomg1\fR \fIbet2\fR \&\fIomg2\fR and prints the corresponding values of \fIalp1\fR \fIalp2\fR \fIs12\fR. .IP 3. 4 Command line arguments \fB\-L\fR \fIbet1\fR \fIomg1\fR \fIalp1\fR specify a geodesic line. \fBGeod3Solve\fR then accepts a sequence of \fIs12\fR values (one per line) on standard input and prints \fIbet2\fR \fIomg2\fR \fIalp2\fR for each. This generates a sequence of points on a single geodesic. .SH OPTIONS .IX Header "OPTIONS" .IP \fB\-i\fR 4 .IX Item "-i" perform an inverse geodesic calculation (see 2 above). .IP "\fB\-L\fR \fIbet1\fR \fIomg1\fR \fIalp1\fR" 4 .IX Item "-L bet1 omg1 alp1" line mode (see 3 above); generate a sequence of points along the geodesic specified by \fIbet1\fR \fIomg1\fR \fIalp1\fR. The \fB\-w\fR flag can be used to swap the default order of the 2 geographic coordinates, provided that it appears before \fB\-L\fR. .IP "\fB\-t\fR \fIa\fR \fIb\fR \fIc\fR" 4 .IX Item "-t a b c" specify the ellipsoid via its major semiaxis \fIa\fR, median semiaxis \fIb\fR, and minor semixis \fIc\fR. By default, we have \fIa\fR = 6378172 m, \fIb\fR = 6378102 m, \fIc\fR = 6356752 m, an approximate triaxial model of the earth. (With this model \fIomg\fR = 0deg, corresponds to \fIlon\fR = \-14.93deg. .IP "\fB\-e\fR \fIb\fR \fIe2\fR \fIk2\fR \fIkp2\fR" 4 .IX Item "-e b e2 k2 kp2" specify the ellipsoid via the median semiaxis, \fIb\fR and the shape parameters \fIe2\fR = (\fIa\fR^2 \- \fIc\fR^2)/\fIb\fR^2, \fIk2\fR = (\fIb\fR^2 \- \&\fIc\fR^2)/(\fIa\fR^2 \- \fIc\fR^2), and \fIkp2\fR = (\fIa\fR^2 \- \fIb\fR^2)/(\fIa\fR^2 \- \&\fIc\fR^2). Simple fractions are allowed for \fIe2\fR, \fIk2\fR, and \fIkp2\fR. Internally, the supplied values of \fIk2\fR and \fIkp2\fR are normalized so that \fIk2\fR + \fIkp2\fR = 1. .IP "\fB\-e2\fR \fIb\fR \fIf\fR" 4 .IX Item "-e2 b f" specify a biaxial ellipsoid via its equatorial radius \fIb\fR and flattening \fIf\fR. A simple fraction, is allowed for \fIf\fR. In this mode, latitudes are interpreted as geodetic latitudes on both input and output. If \fIf\fR is negative, \fIbet\fR and \fIomg\fR are swapped so that latitude and longitude have their conventional interpretations (e.g., longitude measures the angle about the axis of symmetry). .IP \fB\-u\fR 4 .IX Item "-u" unroll the latitude and longitude. Normally, on output latitudes and longitudes are reduced to lie in [\-90deg,90deg] and [\-180deg,180deg) respectively. However with this option, the returned longitude \&\fIbet2\fR and \fIomg2\fR are "unrolled" so that \fIbet2\fR \- \fIbet1\fR and \&\fIomg2\fR \- \fIomg1\fR indicates how often and in what sense the geodesic has encircled the ellipsoid. .IP \fB\-d\fR 4 .IX Item "-d" output angles as degrees, minutes, seconds instead of decimal degrees. .IP \fB\-:\fR 4 .IX Item "-:" like \fB\-d\fR, except use : as a separator instead of the d, \*(Aq, and " delimiters. .IP \fB\-w\fR 4 .IX Item "-w" toggle the longitude first flag (it starts off); if the flag is on, then on input and output, longitude precedes latitude (except that, on input, this can be overridden by a hemisphere designator, \fIN\fR, \fIS\fR, \fIE\fR, \&\fIW\fR). .IP \fB\-f\fR 4 .IX Item "-f" full output; each line of output consists of 7 quantities: \fIbet1\fR \&\fIomg1\fR \fIalp1\fR \fIbet2\fR \fIomg2\fR \fIalp2\fR \fIs12\fR. .IP "\fB\-p\fR \fIprec\fR" 4 .IX Item "-p prec" set the output precision to \fIprec\fR (default 3). For distances, \fIprec\fR is the number of digits after the decimal point for ellipsoids which are approximately the same size as the Earth; for other ellipsoids the precision is adjusted to retain the same relative precision. For latitudes and longitudes (in degrees), the number of digits after the decimal point is \fIprec\fR + 5. For cartesian directions, the precision is \&\fIprec\fR + 7. .IP "\fB\-\-comment\-delimiter\fR \fIcommentdelim\fR" 4 .IX Item "--comment-delimiter commentdelim" set the comment delimiter to \fIcommentdelim\fR (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). .IP \fB\-\-version\fR 4 .IX Item "--version" print version and exit. .IP \fB\-h\fR 4 .IX Item "-h" print usage and exit. .IP \fB\-\-help\fR 4 .IX Item "--help" print full documentation and exit. .IP "\fB\-\-input\-file\fR \fIinfile\fR" 4 .IX Item "--input-file infile" read input from the file \fIinfile\fR instead of from standard input; a file name of "\-" stands for standard input. .IP "\fB\-\-input\-string\fR \fIinstring\fR" 4 .IX Item "--input-string instring" read input from the string \fIinstring\fR instead of from standard input. All occurrences of the line separator character (default is a semicolon) in \fIinstring\fR are converted to newlines before the reading begins. .IP "\fB\-\-line\-separator\fR \fIlinesep\fR" 4 .IX Item "--line-separator linesep" set the line separator character to \fIlinesep\fR. By default this is a semicolon. .IP "\fB\-\-output\-file\fR \fIoutfile\fR" 4 .IX Item "--output-file outfile" write output to the file \fIoutfile\fR instead of to standard output; a file name of "\-" stands for standard output. .SH INPUT .IX Header "INPUT" \&\fBGeod3Solve\fR measures all angles in degrees and all lengths (\fIs12\fR) in meters. On input angles (latitude, longitude, azimuth) can be as decimal degrees or degrees, minutes, seconds. For example, \&\f(CW\*(C`40d30\*(C'\fR, \f(CW\*(C`40d30\*(Aq\*(C'\fR, \f(CW\*(C`40:30\*(C'\fR, \f(CW\*(C`40.5d\*(C'\fR, and \f(CW40.5\fR are all equivalent. By default, latitude precedes longitude for each point (the \fB\-w\fR flag switches this convention); however on input either may be given first by appending (or prepending) \fIN\fR or \fIS\fR to the latitude and \fIE\fR or \fIW\fR to the longitude. Azimuths are measured clockwise from north; however this may be overridden with \fIE\fR or \&\fIW\fR. .PP For details on the allowed formats for angles, see the \f(CW\*(C`GEOGRAPHIC COORDINATES\*(C'\fR section of \fBGeoConvert\fR\|(1). .SH ERRORS .IX Header "ERRORS" An illegal line of input will print an error message to standard output beginning with \f(CW\*(C`ERROR:\*(C'\fR and causes \fBGeod3Solve\fR to return an exit code of 1. However, an error does not cause \fBGeod3Solve\fR to terminate; following lines will be converted. .SH EXAMPLES .IX Header "EXAMPLES" Route from JFK Airport to Singapore Changi Airport on a triaxial ellipsoid: .PP .Vb 5 \& echo 40:38:23N 073:46:44W\-19.43W X 01:21:33N 103:59:22E\-19.43W | \& tr X \*(Aq\en\*(Aq | \& tools/Cart3Convert \-G | tools/Cart3Convert \-E \-r | tr \*(Aq\en\*(Aq \*(Aq \*(Aq | \& tools/Geod3Solve \-i \-: \-p 0 \& => 003:15:05.9 177:27:09.0 15339505 .Ve .PP The steps here are shift for longitude of major axis (\-19.43d), convert to geocentric for biaxial Earth, convert to ellipsoidal for triaxial Earth, compute geodesic distance. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBCart3Convert\fR\|(1). .PP The algorithms are described in C. F. F. Karney, \&\fIJacobi\*(Aqs solution for geodesics on a triaxial ellipsoid\fR, Technical Report, SRI International, Nov. 2025, . .PP The Wikipedia page, Geodesics on an ellipsoid, . .SH AUTHOR .IX Header "AUTHOR" \&\fBGeod3Solve\fR was written by Charles Karney. .SH HISTORY .IX Header "HISTORY" \&\fBGeod3Solve\fR was added to GeographicLib, , in version 2.6.