Code covered by the BSD License

### Highlights from Geodesics on an ellipsoid of revolution

5.0
5.0 | 2 ratings Rate this file 36 Downloads (last 30 days) File Size: 26.2 KB File ID: #39108 Version: 1.43

# Geodesics on an ellipsoid of revolution

### Charles Karney (view profile)

20 Nov 2012 (Updated )

Solutions of the direct and inverse geodesic problems

File Information
Description

This package is now DEPRECATED. Its functionality has been incorporated
into
GeographicLib toolbox
http://www.mathworks.com/matlabcentral/fileexchange/50605
This package includes three routines GEODDISTANCE, GEODRECKON, and
GEODAREA which solve various problems involving geodesics on the surface
of an ellipsoid of revolution. These are based on the paper

C. F. F. Karney, Algorithms for geodesics,
J. Geodesy 87, 43-55 (2013);
https://dx.doi.org/10.1007/s00190-012-0578-z

which, in turn, is based on the classic solution of the geodesic
problems pioneered by Legendre (1806), Bessel (1825), and Helmert
(1880).

GEODRECKON solves the direct geodesic problem (determining an end point
given a starting point, range, and bearing). GEODDISTANCE solves the
inverse geodesic problem (determining the shortest distance between two
points). GEODAREA determines the area of a polygon whose edges are
geodesics.

* The routines are accurate to round off for abs(f) < 1/50. For
example, for the WGS84 ellipsoid, the error in the distance returned
by GEODDISTANCE is less then 15 nanometers.
* The routines work for prolate (as well as oblate) ellipsoids.
* GEODDISTANCE converges for all inputs.
* Differential and integral properties of the geodesics are computed.
* GEODAREA is accurate regardless of the length of the edges of the
polygon.

Also provided are 3 auxiliary routines, DEFAULTELLIPSOID, ECC2FLAT, and
FLAT2ECC.

Use GEODDOC to obtain a more detailed description.

Acknowledgements

Geographiclib inspired this file.

Required Products Robust Control Toolbox
MATLAB
MATLAB release MATLAB 8.4 (R2014b)
MATLAB Search Path
```/
/geographiclib-matlab```
29 Oct 2014 Charles Karney

### Charles Karney (view profile)

There's a bad bug in the area calculation in the Matlab routine
geodreckon. Probably, most people calculate areas as part of the
solution of inverse problem using geoddistance; this might explain why
this bug has gone unnoticed for so long. Here is the fix which will be
included in the next release of GeographicLib.

--- old/geographiclib-matlab/geodreckon.m 2014-10-02 08:08:46.000000000 -0400
+++ new/geographiclib-matlab/geodreckon.m 2014-10-28 18:02:05.000000000 -0400
@@ -225,7 +225,7 @@

if areap
C4x = C4coeff(n);
- C4a = C4f(eps, C4x);
+ C4a = C4f(epsi, C4x);
A4 = (a^2 * e2) * calp0 .* salp0;
B41 = SinCosSeries(false, ssig1, csig1, C4a);
B42 = SinCosSeries(false, ssig2, csig2, C4a);

Comment only
21 Dec 2013 Ryan

### Ryan (view profile)

This... is absolutely wonderful. I spent ages looking for a toolbox that would calculate geodesic areas. I figured that my only two options would be to purchase the MATLAB mapping toolbox or write a routine myself. I'm so glad I finally found this. Thank you kindly, sir.

03 Feb 2013 littyer

### littyer (view profile)

nice

03 Dec 2012 1.3

Synchronize files with GeographicLib 1.27.

11 Dec 2012 1.5

Update to GeographicLib 1.28. Fixes 2 bugs: (1) incorrect area returned in certain obscure cases; (2) m12 incorrect for meridional geodesics.

16 Jan 2013 1.6

Update journal reference.

02 Jul 2013 1.7

Minor improvements to the calculation of short geodesics and the computation of areas.

02 Oct 2014 1.8

Synchronize with GeographicLib 1.38.
Minor documentation changes only.

11 Nov 2014 1.9

Synchronize with GeographicLib 1.39. Fix the bug in geodreckon
noted on 2014-10-29. Provide the option to prevent the longitude
returned in geodreckon from being reduced to [-180,180).

12 Nov 2014 1.10

Uncheck toolbox

21 Nov 2014 1.11

Offer as toolbox.

22 Apr 2015 1.12

Update to GeographicLib 1.41.1. Point fix for geodarea.m to handle
polygons which encircle the pole multiple times. E.g.,
geodarea(89+zeros(6,1), [-360:120:240]')
used to return -2.5500e+14 (incorrect);
it now returns 3.2415e+10 (correct).

27 Apr 2015 1.13

Deprecation notice. Use the GeographicLib toolbox instead.

22 May 2015 1.43

Synchronize with GeographicLib 1.43.
Fix bug in the long_unroll feature of geodreckon.