Module unit_sphere::vector
source · Expand description
The vector module contains functions for performing great circle
calculations using Vector3ds to represent points and great circle poles
on a unit sphere.
A Vector3d is a nalgebra Vector3<f64>.
Modules§
- The
intersectionmodule contains functions for calculating great-circle intersections using vectors.
Constants§
- The minimum value of the square of distance.
Functions§
- The Great Circle distance of a point along the arc relative to a, (+ve) ahead of a, (-ve) behind a.
- Determine whether two
Vector3ds are orthogonal (perpendicular). - Calculate Great Circle along and across track distances.
- Calculate the azimuth at a point on the Great Circle defined by pole.
- Calculate the direction vector along a Great Circle from an initial position and an azimuth.
See: Panou and Korakitis equations: 30, 31, & 32a https://arxiv.org/abs/1811.03513 - Calculate the relative distance of two points on a Great Circle arc. @pre both points must be on the Great Circle defined by
pole. - Calculate the right hand pole vector of a Great Circle from an initial position and an azimuth.
See: http://www.movable-type.co.uk/scripts/latlong-vectors.html#distance - The across track distance of a point relative to a Great Circle pole.
- Calculate the relative longitude of point a from point b.
- Calculate the direction vector of a Great Circle arc.
- Calculate the shortest (Euclidean) distance between two Points.
@post for unit vectors: result <= 2 - Determine whether a
Vector3dis a unit vector. - Determine whether point a is West of point b.
It calculates and compares the perp product of the two points. - Calculate the latitude of a point.
- Calculate the longitude of a point.
- Normalize a vector to lie on the surface of the unit sphere.
Note: this function returns anOptionso uses the British spelling ofnormaliseto differentiate it from the standardnormalizefunction. - Calculate the position of a point along a Great Circle arc.
- Calculate the direction vector of a Great Circle rotated by angle.
- Calculate the position of a point rotated by angle at radius.
- The sine of the along track distance of a point along a Great Circle arc.
It is the triple product of the pole, a and the point: (pole X a) . point = pole . (a X point) - Calculate the square of the Euclidean along track distance of a point from the start of an Arc. It is calculated using the closest point on the plane to the point.
- The square of the Euclidean cross track distance of a point relative to a Great Circle pole.
- Calculate the square of the Euclidean distance between two points. Note: points do NOT need to be valid Points.
@post for unit vectors: result <= 4 - Convert a latitude and longitude to a point on the unit sphere. @pre |lat| <= 90.0 degrees.