pub struct Ellipsoid { /* private fields */ }
Expand description
Representation of a (potentially triaxial) ellipsoid.
Implementations§
source§impl Ellipsoid
impl Ellipsoid
sourcepub fn geodesic_fwd<C: CoordinateTuple>(
&self,
from: &C,
azimuth: f64,
distance: f64
) -> Coor4D
pub fn geodesic_fwd<C: CoordinateTuple>( &self, from: &C, azimuth: f64, distance: f64 ) -> Coor4D
For general geodesics, we use the algorithm by Vincenty (1975), with updates by the same author (1976). The Vincenty algorithm is relatively simple to implement, but for near-antipodal cases, it suffers from lack of convergence and loss of accuracy.
Karney (2012, 2013) presented an algorithm which is exact to machine precision, and converges everywhere. The crate geographiclib-rs, by Federico Dolce and Michael Kirk, provides a Rust implementation of Karney’s algorithm.
sourcepub fn geodesic_inv<C: CoordinateTuple>(&self, from: &C, to: &C) -> Coor4D
pub fn geodesic_inv<C: CoordinateTuple>(&self, from: &C, to: &C) -> Coor4D
See geodesic_fwd
sourcepub fn distance<G: CoordinateTuple>(&self, from: &G, to: &G) -> f64
pub fn distance<G: CoordinateTuple>(&self, from: &G, to: &G) -> f64
Geodesic distance between two points. Assumes the first coordinate is longitude, second is latitude.
§See also:
§Examples
// Compute the distance between Copenhagen and Paris
use geodesy::prelude::*;
if let Ok(ellps) = Ellipsoid::named("GRS80") {
let p0 = Coor2D::geo(55., 12.);
let p1 = Coor2D::geo(49., 2.);
let d = ellps.distance(&p0, &p1);
assert!((d - 956_066.231_959).abs() < 1e-5);
}
source§impl Ellipsoid
impl Ellipsoid
The normal gravity implementations are based solely on information from HandWiki.
Currently they remain untested in the absolute sense of the word: The test suite checks for regressions, but the values used for comparison are entirely internally sourced.
sourcepub fn somigliana_gravity(
&self,
latitude: f64,
gamma_a: Option<f64>,
gamma_b: Option<f64>
) -> f64
pub fn somigliana_gravity( &self, latitude: f64, gamma_a: Option<f64>, gamma_b: Option<f64> ) -> f64
The Somigliana normal gravity formula. If the equatorial
normal gravity, gamma_a, and/or the polar normal gravity,
gamma_b, is given as None
, the values for GRS80 is used.
sourcepub fn cassinis_gravity_1930(&self, latitude: f64) -> f64
pub fn cassinis_gravity_1930(&self, latitude: f64) -> f64
The international gravity formula 1930, for use with the international (Hayford) ellipsoid (or for mis-use with any other ellipsoid)
sourcepub fn jeffreys_gravity_1948(&self, latitude: f64) -> f64
pub fn jeffreys_gravity_1948(&self, latitude: f64) -> f64
Harold Jeffreys’ 1948 improvement to the international gravity formula 1930
sourcepub fn grs67_gravity(&self, latitude: f64) -> f64
pub fn grs67_gravity(&self, latitude: f64) -> f64
The GRS67 gravity formula. Differs from GRS80 at the mgal level
sourcepub fn grs80_gravity(&self, latitude: f64) -> f64
pub fn grs80_gravity(&self, latitude: f64) -> f64
The international gravity formula 1980, for use with systems based on GRS80
sourcepub fn cassinis_height_correction(&self, height: f64, density: f64) -> f64
pub fn cassinis_height_correction(&self, height: f64, density: f64) -> f64
Height correction according to Cassinis. Depends on the local rock density (in kg/m³). The value is to be subtracted from the normal gravity on the ellipsoid.
sourcepub fn grs67_height_correction(&self, latitude: f64, height: f64) -> f64
pub fn grs67_height_correction(&self, latitude: f64, height: f64) -> f64
The GRS67 height correction formula (used for all systems since GRS67). The value is to be subtracted from the normal gravity on the ellipsoid.
sourcepub fn welmec(&self, latitude: f64, height: f64) -> f64
pub fn welmec(&self, latitude: f64, height: f64) -> f64
The WELMEC method combines the latitudinal and the height correction of the normal gravity into a single formula.
The HandWiki page states that the WELMEC formula is used in German standards labs (but probably EU+-wide, since the WELMEC organization covers the EU, EFTA, and a number of additional countries).
Continuing: The free-fall acceleration g is calculated with respect to the average latitude φ and the average height above sea level H.
NOTE: Orthometric height! And with the reference to averages of height and latitude, I suppose that this is for post-processing of surveys, not of individual observations? - or perhaps the HandWiki text is just slightly wrong here.
source§impl Ellipsoid
impl Ellipsoid
sourcepub fn latitude_geographic_to_geocentric(&self, geographic: f64) -> f64
pub fn latitude_geographic_to_geocentric(&self, geographic: f64) -> f64
Geographic latitude, 𝜙 to geocentric latitude, 𝜃. See also latitude_geocentric_to_geographic
sourcepub fn latitude_geocentric_to_geographic(&self, geocentric: f64) -> f64
pub fn latitude_geocentric_to_geographic(&self, geocentric: f64) -> f64
Geocentric latitude, 𝜃 to geographic latitude, 𝜙. See also latitude_geographic_to_geocentric
sourcepub fn latitude_geographic_to_reduced(&self, geographic: f64) -> f64
pub fn latitude_geographic_to_reduced(&self, geographic: f64) -> f64
Geographic latitude, 𝜙 to reduced latitude, 𝛽. See also latitude_reduced_to_geographic
sourcepub fn latitude_reduced_to_geographic(&self, reduced: f64) -> f64
pub fn latitude_reduced_to_geographic(&self, reduced: f64) -> f64
Reduced latitude, 𝛽 to geographic latitude, 𝜙 See also latitude_geographic_to_reduced
sourcepub fn latitude_geographic_to_isometric(&self, geographic: f64) -> f64
pub fn latitude_geographic_to_isometric(&self, geographic: f64) -> f64
Geographic latitude, 𝜙 to Isometric latitude, 𝜓. See also latitude_isometric_to_geographic
sourcepub fn latitude_isometric_to_geographic(&self, isometric: f64) -> f64
pub fn latitude_isometric_to_geographic(&self, isometric: f64) -> f64
Isometric latitude, 𝜓 to geographic latitude, 𝜙. See also latitude_geographic_to_isometric
sourcepub fn coefficients_for_rectifying_latitude_computations(
&self
) -> FourierCoefficients
pub fn coefficients_for_rectifying_latitude_computations( &self ) -> FourierCoefficients
Obtain the coefficients needed for working with rectifying latitudes
sourcepub fn latitude_geographic_to_rectifying(
&self,
geographic_latitude: f64,
coefficients: &FourierCoefficients
) -> f64
pub fn latitude_geographic_to_rectifying( &self, geographic_latitude: f64, coefficients: &FourierCoefficients ) -> f64
Geographic latitude, 𝜙, to rectifying, 𝜇
sourcepub fn latitude_rectifying_to_geographic(
&self,
rectifying_latitude: f64,
coefficients: &FourierCoefficients
) -> f64
pub fn latitude_rectifying_to_geographic( &self, rectifying_latitude: f64, coefficients: &FourierCoefficients ) -> f64
Rectifying latitude, 𝜇, to geographic, 𝜙
sourcepub fn coefficients_for_conformal_latitude_computations(
&self
) -> FourierCoefficients
pub fn coefficients_for_conformal_latitude_computations( &self ) -> FourierCoefficients
Obtain the coefficients needed for working with conformal latitudes
sourcepub fn latitude_geographic_to_conformal(
&self,
geographic_latitude: f64,
coefficients: &FourierCoefficients
) -> f64
pub fn latitude_geographic_to_conformal( &self, geographic_latitude: f64, coefficients: &FourierCoefficients ) -> f64
Geographic latitude, 𝜙, to conformal, 𝜒
sourcepub fn latitude_conformal_to_geographic(
&self,
conformal_latitude: f64,
coefficients: &FourierCoefficients
) -> f64
pub fn latitude_conformal_to_geographic( &self, conformal_latitude: f64, coefficients: &FourierCoefficients ) -> f64
Conformal latitude, 𝜒, to geographic, 𝜙
sourcepub fn coefficients_for_authalic_latitude_computations(
&self
) -> FourierCoefficients
pub fn coefficients_for_authalic_latitude_computations( &self ) -> FourierCoefficients
Obtain the coefficients needed for working with authalic latitudes
sourcepub fn latitude_geographic_to_authalic(
&self,
geographic_latitude: f64,
coefficients: &FourierCoefficients
) -> f64
pub fn latitude_geographic_to_authalic( &self, geographic_latitude: f64, coefficients: &FourierCoefficients ) -> f64
Geographic latitude, 𝜙, to authalic, 𝜉
sourcepub fn latitude_authalic_to_geographic(
&self,
authalic_latitude: f64,
coefficients: &FourierCoefficients
) -> f64
pub fn latitude_authalic_to_geographic( &self, authalic_latitude: f64, coefficients: &FourierCoefficients ) -> f64
Authalic latitude, 𝜉, to geographic, 𝜙
source§impl Ellipsoid
impl Ellipsoid
sourcepub fn normalized_meridian_arc_unit(&self) -> f64
pub fn normalized_meridian_arc_unit(&self) -> f64
The Normalized Meridian Arc Unit, Qn, is the mean length of one radian of the meridian. “Normalized”, because we measure it in units of the semimajor axis, a.
König und Weise p.50 (96), p.19 (38b), p.5 (2), here using the extended version from Karney 2010 eq. (29)
sourcepub fn rectifying_radius(&self) -> f64
pub fn rectifying_radius(&self) -> f64
The rectifying radius, A, is the radius of a sphere of the same circumference as the length of a full meridian on the ellipsoid.
Closely related to the normalized meridian arc unit.
Karney (2010) eq. (29), elaborated in Deakin et al (2012) eq. (41)
sourcepub fn rectifying_radius_bowring(&self) -> f64
pub fn rectifying_radius_bowring(&self) -> f64
The rectifying radius, A, following Bowring (1983): An utterly elegant way of writing out the series truncated after the n⁴ term. In general, however, prefer using the n⁸ version implemented as rectifying_radius, based on Karney (2010) eq. (29), as elaborated in Deakin et al (2012) eq. (41)
sourcepub fn meridian_quadrant(&self) -> f64
pub fn meridian_quadrant(&self) -> f64
The Meridian Quadrant, Qm, is the distance from the equator to one of the poles. i.e. π/2 · Qn · a, where Qn is the normalized meridian arc unit
sourcepub fn meridian_latitude_to_distance(&self, latitude: f64) -> f64
pub fn meridian_latitude_to_distance(&self, latitude: f64) -> f64
The distance, M, along a meridian from the equator to the given latitude is a special case of a geodesic length.
This implementation follows the remarkably simple algorithm by Bowring (1983).
See also Wikipedia: Transverse Mercator.
Deakin et al provides a higher order (n⁸) derivation.
sourcepub fn meridian_distance_to_latitude(&self, distance_from_equator: f64) -> f64
pub fn meridian_distance_to_latitude(&self, distance_from_equator: f64) -> f64
Compute the latitude of a point, given M, its distance from the equator, along its local meridian.
This implementation follows the remarkably simple algorithm by Bowring (1983).
See also meridian_latitude_to_distance
source§impl Ellipsoid
impl Ellipsoid
pub fn triaxial( semimajor_x_axis: f64, semimajor_y_axis: f64, flattening: f64 ) -> Ellipsoid
sourcepub fn named(name: &str) -> Result<Ellipsoid, Error>
pub fn named(name: &str) -> Result<Ellipsoid, Error>
Predefined ellipsoid; built-in or defined in asset collections
sourcepub fn linear_eccentricity(&self) -> f64
pub fn linear_eccentricity(&self) -> f64
The linear eccentricity E = sqrt(a² - b²). Negative if b > a.
sourcepub fn eccentricity_squared(&self) -> f64
pub fn eccentricity_squared(&self) -> f64
The squared eccentricity e² = (a² - b²) / a².
sourcepub fn eccentricity(&self) -> f64
pub fn eccentricity(&self) -> f64
The eccentricity e
sourcepub fn second_eccentricity_squared(&self) -> f64
pub fn second_eccentricity_squared(&self) -> f64
The squared second eccentricity e’² = (a² - b²) / b² = e² / (1 - e²)
sourcepub fn second_eccentricity(&self) -> f64
pub fn second_eccentricity(&self) -> f64
The second eccentricity e’
sourcepub fn semimajor_axis(&self) -> f64
pub fn semimajor_axis(&self) -> f64
The semimajor axis, a
sourcepub fn semimedian_axis(&self) -> f64
pub fn semimedian_axis(&self) -> f64
The semimedian axis, ay
sourcepub fn semiminor_axis(&self) -> f64
pub fn semiminor_axis(&self) -> f64
The semiminor axis, b
sourcepub fn flattening(&self) -> f64
pub fn flattening(&self) -> f64
The flattening, f = (a - b)/a
sourcepub fn second_flattening(&self) -> f64
pub fn second_flattening(&self) -> f64
The second flattening, f = (a - b) / b
sourcepub fn third_flattening(&self) -> f64
pub fn third_flattening(&self) -> f64
The third flattening, n = (a - b) / (a + b) = f / (2 - f)
sourcepub fn aspect_ratio(&self) -> f64
pub fn aspect_ratio(&self) -> f64
The aspect ratio, b / a = 1 - f = sqrt(1 - e²)
sourcepub fn prime_vertical_radius_of_curvature(&self, latitude: f64) -> f64
pub fn prime_vertical_radius_of_curvature(&self, latitude: f64) -> f64
The radius of curvature in the prime vertical, N
sourcepub fn meridian_radius_of_curvature(&self, latitude: f64) -> f64
pub fn meridian_radius_of_curvature(&self, latitude: f64) -> f64
The meridian radius of curvature, M
sourcepub fn polar_radius_of_curvature(&self) -> f64
pub fn polar_radius_of_curvature(&self) -> f64
The polar radius of curvature, c