Struct geodesy::Ellipsoid

source ·
pub struct Ellipsoid { /* private fields */ }
Expand description

Representation of a (potentially triaxial) ellipsoid.

Implementations§

source§

impl Ellipsoid

source

pub fn cartesian(&self, geographic: &Coor4D) -> Coor4D

Geographic to cartesian conversion.

Follows the the derivation given by Bowring (1976 and 1985)

source

pub fn geographic(&self, cartesian: &Coor4D) -> Coor4D

Cartesian to geogaphic conversion.

Follows the the derivation given by Bowring (1976 and 1985)

source§

impl Ellipsoid

source

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.

source

pub fn geodesic_inv<C: CoordinateTuple>(&self, from: &C, to: &C) -> Coor4D

source

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:

hypot2, hypot3

§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

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.

source

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.

source

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)

source

pub fn jeffreys_gravity_1948(&self, latitude: f64) -> f64

Harold Jeffreys’ 1948 improvement to the international gravity formula 1930

source

pub fn grs67_gravity(&self, latitude: f64) -> f64

The GRS67 gravity formula. Differs from GRS80 at the mgal level

source

pub fn grs80_gravity(&self, latitude: f64) -> f64

The international gravity formula 1980, for use with systems based on GRS80

source

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.

source

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.

source

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

source

pub fn latitude_geographic_to_geocentric(&self, geographic: f64) -> f64

Geographic latitude, 𝜙 to geocentric latitude, 𝜃. See also latitude_geocentric_to_geographic

source

pub fn latitude_geocentric_to_geographic(&self, geocentric: f64) -> f64

Geocentric latitude, 𝜃 to geographic latitude, 𝜙. See also latitude_geographic_to_geocentric

source

pub fn latitude_geographic_to_reduced(&self, geographic: f64) -> f64

Geographic latitude, 𝜙 to reduced latitude, 𝛽. See also latitude_reduced_to_geographic

source

pub fn latitude_reduced_to_geographic(&self, reduced: f64) -> f64

Reduced latitude, 𝛽 to geographic latitude, 𝜙 See also latitude_geographic_to_reduced

source

pub fn latitude_geographic_to_isometric(&self, geographic: f64) -> f64

Geographic latitude, 𝜙 to Isometric latitude, 𝜓. See also latitude_isometric_to_geographic

source

pub fn latitude_isometric_to_geographic(&self, isometric: f64) -> f64

Isometric latitude, 𝜓 to geographic latitude, 𝜙. See also latitude_geographic_to_isometric

source

pub fn coefficients_for_rectifying_latitude_computations( &self ) -> FourierCoefficients

Obtain the coefficients needed for working with rectifying latitudes

source

pub fn latitude_geographic_to_rectifying( &self, geographic_latitude: f64, coefficients: &FourierCoefficients ) -> f64

Geographic latitude, 𝜙, to rectifying, 𝜇

source

pub fn latitude_rectifying_to_geographic( &self, rectifying_latitude: f64, coefficients: &FourierCoefficients ) -> f64

Rectifying latitude, 𝜇, to geographic, 𝜙

source

pub fn coefficients_for_conformal_latitude_computations( &self ) -> FourierCoefficients

Obtain the coefficients needed for working with conformal latitudes

source

pub fn latitude_geographic_to_conformal( &self, geographic_latitude: f64, coefficients: &FourierCoefficients ) -> f64

Geographic latitude, 𝜙, to conformal, 𝜒

source

pub fn latitude_conformal_to_geographic( &self, conformal_latitude: f64, coefficients: &FourierCoefficients ) -> f64

Conformal latitude, 𝜒, to geographic, 𝜙

source

pub fn coefficients_for_authalic_latitude_computations( &self ) -> FourierCoefficients

Obtain the coefficients needed for working with authalic latitudes

source

pub fn latitude_geographic_to_authalic( &self, geographic_latitude: f64, coefficients: &FourierCoefficients ) -> f64

Geographic latitude, 𝜙, to authalic, 𝜉

source

pub fn latitude_authalic_to_geographic( &self, authalic_latitude: f64, coefficients: &FourierCoefficients ) -> f64

Authalic latitude, 𝜉, to geographic, 𝜙

source§

impl Ellipsoid

source

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)

source

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)

source

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)

source

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

source

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.

source

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

source

pub fn new(semimajor_axis: f64, flattening: f64) -> Ellipsoid

User defined ellipsoid

source

pub fn triaxial( semimajor_x_axis: f64, semimajor_y_axis: f64, flattening: f64 ) -> Ellipsoid

source

pub fn named(name: &str) -> Result<Ellipsoid, Error>

Predefined ellipsoid; built-in or defined in asset collections

source

pub fn linear_eccentricity(&self) -> f64

The linear eccentricity E = sqrt(a² - b²). Negative if b > a.

source

pub fn eccentricity_squared(&self) -> f64

The squared eccentricity e² = (a² - b²) / a².

source

pub fn eccentricity(&self) -> f64

The eccentricity e

source

pub fn second_eccentricity_squared(&self) -> f64

The squared second eccentricity e’² = (a² - b²) / b² = e² / (1 - e²)

source

pub fn second_eccentricity(&self) -> f64

The second eccentricity e’

source

pub fn semimajor_axis(&self) -> f64

The semimajor axis, a

source

pub fn semimedian_axis(&self) -> f64

The semimedian axis, ay

source

pub fn semiminor_axis(&self) -> f64

The semiminor axis, b

source

pub fn flattening(&self) -> f64

The flattening, f = (a - b)/a

source

pub fn second_flattening(&self) -> f64

The second flattening, f = (a - b) / b

source

pub fn third_flattening(&self) -> f64

The third flattening, n = (a - b) / (a + b) = f / (2 - f)

source

pub fn aspect_ratio(&self) -> f64

The aspect ratio, b / a = 1 - f = sqrt(1 - e²)

source

pub fn prime_vertical_radius_of_curvature(&self, latitude: f64) -> f64

The radius of curvature in the prime vertical, N

source

pub fn meridian_radius_of_curvature(&self, latitude: f64) -> f64

The meridian radius of curvature, M

source

pub fn polar_radius_of_curvature(&self) -> f64

The polar radius of curvature, c

Trait Implementations§

source§

impl Clone for Ellipsoid

source§

fn clone(&self) -> Ellipsoid

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Ellipsoid

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Ellipsoid

GRS80 is the default ellipsoid.

source§

fn default() -> Ellipsoid

Returns the “default value” for a type. Read more
source§

impl PartialEq for Ellipsoid

source§

fn eq(&self, other: &Ellipsoid) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Ellipsoid

source§

impl StructuralPartialEq for Ellipsoid

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CoordinateMetadata for T
where T: ?Sized,

source§

fn crs_id(&self) -> Option<MdIdentifier>

source§

fn crs(&self) -> Option<Crs>

source§

fn coordinate_epoch(&self) -> Option<DataEpoch>

source§

fn is_valid(&self) -> bool

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.