This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Documentation / Mathematica / Add-ons & Links / Standard Packages / Miscellaneous /

Miscellaneous`Geodesy`

Geodesy is the branch of science that deals with such topics as determining positions and areas over large parts of the Earth, the shape and size of the Earth, and the variations in the Earth's gravitational and magnetic fields. The primary functions in this package are used for determining the distance between two points.

Finding the distance between two points on a sphere.

Each position can be given in degrees as a latitude-longitude pair. A coordinate can also be expressed in the form degrees, minutes, seconds. A negative value for a coordinate indicates that the coordinate is South latitude or West longitude. Distances are returned in kilometers as the default.

This loads the package.

In[1]:= << Miscellaneous`Geodesy`

This gives the distance between lat., long., and N. lat., E. long., using a spherical model.

In[2]:= SphericalDistance[{0, 0}, {45, 45}] //N

Out[2]=

Here is the distance between the same points using a spheroidal model.

In[3]:= SpheroidalDistance[{0, 0}, {45, 45}] //N

Out[3]=

This is the difference between the two models.

In[4]:= % - %%

Out[4]=

The spherical model is based on an exact formula, while the spheroidal model is an approximation algorithm that is fairly good for distances of less than 10,000 kilometers. Because of the nature of this approximation, all computation with SpheroidalDistance is done with machine-precision numbers.

Options to control the size of the shape in the models.

The distances between points can be modified by using different values for the radius of the sphere, or the length of the semimajor axis and the eccentricity of the spheroid using the options Radius, SemimajorAxis, and Eccentricity, respectively. The default values for these options are those for the Earth from the WGS-84 standard, in kilometers.

Conversions between models and coordinate systems.

The simplest way to convert to the sphere from the spheroid is to use the authalic sphere. This sphere has the same surface area as the reference spheroid.

Here is a comparison of the two shapes, with an ellipse whose eccentricity is much larger than the Earth, for effect.

In[5]:= Show[Graphics[{
Circle[{0, 0}, ToAuthalicRadius[1, .6]],
Dashing[{.03}],
Circle[{0, 0}, {1, Sqrt[1 - (.6)^2]} ]}],
AspectRatio -> Automatic]

Out[5]=

Note that the eccentricity used in the above diagram was .6. The actual eccentricity of the Earth's spheroid is approximately .081.