Distances

Distances are functors that are evaluated with a pair of points. The definition that is used depends on the manifold of the points, which is available at compile time.

Meshes.GeometricDistance — Type
GeometricDistance

A distance between points that is meaningful in physical settings.

Distances are functors, and are evaluated with a pair of points:

d = EuclideanDistance()

d(p₁, p₂)

The definition that is used depends on the manifold of the points, which is available at compile time.

source
Meshes.EuclideanDistance — Type
EuclideanDistance()

Length of the straight line connecting two points in the space where they are embedded. For points on the ellipsoid (🌐) this is the chord through the interior of the ellipsoid, which is shorter than any path along the surface.

See also GeodesicDistance.

Examples

d = EuclideanDistance()

d(Point(0, 0), Point(1, 1))

d(Point(LatLon(0, 0)), Point(LatLon(0, 1)))
source
Meshes.GeodesicDistance — Type
GeodesicDistance()

Length of the shortest path along the manifold of two points. In Euclidean space (𝔼) this is the straight line connecting them. On the ellipsoid (🌐) this is the geodesic of the ellipsoid attached to the datum of the coordinate reference system, and is computed with the series of Karney (2013).

See also EuclideanDistance.

Examples

d = GeodesicDistance()

d(Point(LatLon(0, 0)), Point(LatLon(0, 1)))

References

source

In Euclidean space the Euclidean distance is the length of the straight line connecting the points:

d = EuclideanDistance()

d(Point(0, 0), Point(3, 4))
5.0 m

On the ellipsoid the same distance is the chord that goes through the interior of the Earth, whereas the geodesic distance is the length of the shortest path along the surface:

sydney = Point(LatLon(-33.8688, 151.2093))
london = Point(LatLon(51.5074, -0.1278))

EuclideanDistance()(sydney, london), GeodesicDistance()(sydney, london)
(1.2379161016808214e7 m, 1.698929577054045e7 m)

The ellipsoid is taken from the datum of the coordinate reference system, so all parameters are retrieved automatically for the user.