Ellipsoid

Struct Ellipsoid 

Source
pub struct Ellipsoid {
    pub a: f64,
    pub b: f64,
    pub f: f64,
    pub e: f64,
    pub e_squared: f64,
}
Expand description

Ellipsoid, a simple approximation of the earth’s shape used in most Projections

Fields§

§a: f64

semi-major axis

§b: f64§f: f64

flattening

§e: f64

eccentricity

§e_squared: f64

eccentricity squared

Implementations§

Source§

impl Ellipsoid

Source

pub fn from_a_b(a: f64, b: f64) -> Self

Construct an ellipsoid from major and minor half axis.

Source

pub fn from_a_f_inv(a: f64, f_inv: f64) -> Self

Construct an ellipsoid from major half axis and inverse flattening.

Source

pub fn a(&self) -> f64

Get major half axis.

Source

pub fn b(&self) -> f64

Get minor half axis.

Source

pub fn f_inv(&self) -> f64

👎Deprecated since 0.8.0

Get inverse flattening. This method is deprecated as the inverse flattening is not defined for spheroids (division by zero).

Source

pub fn f(&self) -> f64

Get flattening.

Source

pub fn e(&self) -> f64

Get eccentricity.

Source

pub fn e_squared(&self) -> f64

Get eccentricity squared.

Source

pub fn e_2(&self) -> f64

Calculate secondary eccentricity.

Source

pub fn rho(&self, lat: f64) -> f64

Calculate radius of curvature in the meridian, latitude in radians.

Source

pub fn ny(&self, lat: f64) -> f64

Calculate radius of curvature in the prime vertical, latitude in radians.

Source

pub fn rad_auth(&self) -> f64

Calculate radius of authalic sphere (sphere with the same surface area as the ellipsoid).

Source

pub fn rad_conformal(&self, lat: f64) -> f64

Calculate radius of conformal sphere.

Source

pub fn geocentric_to_deg(&self, x: f64, y: f64, z: f64) -> (f64, f64, f64)

Convert from geocentric position in meters to (longitude, latitude, height), geographic position in decimal degrees and ellipsoid height in meters.

Source

pub fn deg_to_geocentric( &self, lon: f64, lat: f64, height: f64, ) -> (f64, f64, f64)

Convert from geographic position in decimal degrees and ellipsoid height in meters to (x, y, z), geocentric position in meters.

Source

pub fn geocentric_to_rad(&self, x: f64, y: f64, z: f64) -> (f64, f64, f64)

Convert from geocentric position in meters to (longitude, latitude, height), geographic position in radians and ellipsoid height in meters.

Source

pub fn rad_to_geocentric( &self, lon: f64, lat: f64, height: f64, ) -> (f64, f64, f64)

Convert from geographic position in radians and ellipsoid height in meters to (x, y, z), geocentric position in meters.

Trait Implementations§

Source§

impl Clone for Ellipsoid

Source§

fn clone(&self) -> Ellipsoid

Returns a duplicate 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 PseudoSerialize for Ellipsoid

Source§

impl Copy 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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,

Source§

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>,

Source§

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>,

Source§

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.