Provided by: geographiclib-tools_1.21-1ubuntu1_amd64

**NAME**

Geod -- perform geodesic calculations

**SYNOPSIS**

Geod[-i|-llat1lon1azi1] [-a] [-eaf] [-d|-:] [-b] [-f] [-pprec] [--comment-delimitercommentdelim] [--version|-h|--help] [--input-fileinfile|--input-stringinstring] [--line-separatorlinesep] [--output-fileoutfile]

**DESCRIPTION**

The shortest path between two points on the ellipsoid at (lat1,lon1) and (lat2,lon2) is called the geodesic. Its length iss12and the geodesic from point 1 to point 2 has azimuthsazi1andazi2at the two end points.Geodoperates in one of three modes: 1. By default,Geodaccepts lines on the standard input containinglat1lon1azi1s12and printslat2lon2azi2on standard output. This is the direct geodesic calculation. 2. Command line arguments-llat1lon1azi1specify a geodesic line.Geodthen accepts a sequence ofs12values (one per line) on standard input and printslat2lon2azi2for each. This generates a sequence of points on a single geodesic. 3. With the-icommand line argument,Geodperforms the inverse geodesic calculation. It reads lines containinglat1lon1lat2lon2and prints the corresponding values ofazi1azi2s12.

**OPTIONS**

-iperform an inverse geodesic calculation (see 3 above).-lline mode (see 2 above); generate a sequence of points along the geodesic specified bylat1lon1azi1.-aarc mode; on inputandoutputs12is replaced bya12the arc length (in degrees) on the auxiliary sphere. See "AUXILIARY SPHERE".-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. (Also, iff> 1, the flattening is set to 1/f.) 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.-breport thebackazimuth at point 2 instead of the forward azimuth.-ffull output; each line of output consists of 12 quantities:lat1lon1azi1lat2lon2azi2s12a12m12M12M21S12.a12is described in "AUXILIARY SPHERE". The four quantitiesm12,M12,M21, andS12are described in "ADDITIONAL QUANTITIES".-pset the output precision toprec(default 3);precis the precision relative to 1 m. See PRECISION.--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**

Geodmeasures all angles in degrees and all lengths (s12) in meters. On input angles (latitude, longitude, azimuth, arc length) can be as decimal degrees or degrees (d), minutes ('), seconds ("). A decimal point can only appear in the least significant component and the designator (d, ', or ") for this component is optional; thus "40d30", "40d30'", "40.5d", and 40.5 are all equivalent. By default, latitude precedes longitude for each point; 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.

**AUXILIARY** **SPHERE**

Geodesics on the ellipsoid can be transferred to theauxiliarysphereon which the distance is measured in terms of the arc lengtha12(measured in degrees) instead ofs12. In terms ofa12, 180 degrees is the distance from one equator crossing to the next or from the minimum latitude to the maximum latitude. Geodesics witha12> 180 degrees do not correspond to shortest paths. With the-aflag,s12(on both input and output) is replaced bya12. The-aflag doesnotaffect the full output given by the-fflag (which always includes boths12anda12).

**ADDITIONAL** **QUANTITIES**

The-fflag reports four additional quantities. The reduced length of the geodesic,m12, is defined such that if the initial azimuth is perturbed by dazi1(radians) then the second point is displaced bym12dazi1in the direction perpendicular to the geodesic.m12is given in meters. On a curved surface the reduced length obeys a symmetry relation,m12+m21= 0. On a flat surface, we havem12=s12.M12andM21are geodesic scales. If two geodesics are parallel at point 1 and separated by a small distancedt, then they are separated by a distanceM12dtat point 2.M21is defined similarly (with the geodesics being parallel to one another at point 2).M12andM21are dimensionless quantities. On a flat surface, we haveM12=M21= 1. If points 1, 2, and 3 lie on a single geodesic, then the following addition rules hold,m13=m12M23+m23M21,M13=M12M23- (1 -M12M21)m23/m12, andM31=M32M21- (1 -M23M32)m12/m23. Finally,S12is the area between the geodesic from point 1 to point 2 and the equator; i.e., it is the area, measured counter-clockwise, of the quadrilateral with corners (lat1,lon1), (0,lon1), (0,lon2), and (lat2,lon2). It is given in meters^2.

**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 is 5 +prec. For DMS (degree, minute, seconds) output, the number of digits after the decimal point in the seconds component is 1 +prec. 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 causesGeodto return an exit code of 1. However, an error does not causeGeodto terminate; following lines will be converted.

**EXAMPLES**

Route from JFK Airport to Singapore Changi Airport: echo 40:38:23N 073:46:44W 01:21:33N 103:59:22E | Geod -i -: -p 0 003:18:29.9 177:29:09.2 15347628 Waypoints on the route at intervals of 2000km: for ((i = 0; i <= 16; i += 2)); do echo ${i}000000;done | Geod -l 40:38:23N 073:46:44W 003:18:29.9 -: -p 0 40:38:23.0N 073:46:44.0W 003:18:29.9 58:34:45.1N 071:49:36.7W 004:48:48.8 76:22:28.4N 065:32:17.8W 010:41:38.4 84:50:28.0N 075:04:39.2E 150:55:00.9 67:26:20.3N 098:00:51.2E 173:27:20.3 49:33:03.2N 101:06:52.6E 176:07:54.3 31:34:16.5N 102:30:46.3E 177:03:08.4 13:31:56.0N 103:26:50.7E 177:24:55.0 04:32:05.7S 104:14:48.7E 177:28:43.6

**SEE** **ALSO**

The algorithms are described in C. F. F. Karney,Geodesicsonanellipsoidofrevolution, Feb. 2011; preprint <http://arxiv.org/abs/1102.1215>. See also C. F. F. Karney,Algorithmsforgeodesics, Sept. 2011; preprint <http://arxiv.org/abs/1109.4448>.

**AUTHOR**

Geodwas written by Charles Karney.

**HISTORY**

Geodwas added to GeographicLib, <http://geographiclib.sf.net>, in 2009-03.