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: f64semi-major axis
b: f64§f: f64flattening
e: f64eccentricity
e_squared: f64eccentricity squared
Implementations§
Source§impl Ellipsoid
impl Ellipsoid
Sourcepub fn from_a_f_inv(a: f64, f_inv: f64) -> Self
pub fn from_a_f_inv(a: f64, f_inv: f64) -> Self
Construct an ellipsoid from major half axis and inverse flattening.
Sourcepub fn f_inv(&self) -> f64
👎Deprecated since 0.8.0
pub fn f_inv(&self) -> f64
Get inverse flattening. This method is deprecated as the inverse flattening is not defined for spheroids (division by zero).
Sourcepub fn rho(&self, lat: f64) -> f64
pub fn rho(&self, lat: f64) -> f64
Calculate radius of curvature in the meridian, latitude in radians.
Sourcepub fn ny(&self, lat: f64) -> f64
pub fn ny(&self, lat: f64) -> f64
Calculate radius of curvature in the prime vertical, latitude in radians.
Sourcepub fn rad_auth(&self) -> f64
pub fn rad_auth(&self) -> f64
Calculate radius of authalic sphere (sphere with the same surface area as the ellipsoid).
Sourcepub fn rad_conformal(&self, lat: f64) -> f64
pub fn rad_conformal(&self, lat: f64) -> f64
Calculate radius of conformal sphere.
Sourcepub fn geocentric_to_deg(&self, x: f64, y: f64, z: f64) -> (f64, f64, f64)
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.
Sourcepub fn deg_to_geocentric(
&self,
lon: f64,
lat: f64,
height: f64,
) -> (f64, f64, f64)
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.