pub fn new(longitude: T, latitude: T) -> FlatProjection<T> {
        // see https://github.com/mapbox/cheap-ruler/

        let one = T::one();
        let two = T::from(2).unwrap();

        // Values that define WGS84 ellipsoid model of the Earth
        let re: T = T::from(6378.137).unwrap(); // equatorial radius
        let fe: T = one / T::from(298.257223563).unwrap(); // flattening
        let e2: T = fe * (two - fe);

        // Curvature formulas from https://en.wikipedia.org/wiki/Earth_radius#Meridional
        let cos_lat = latitude.to_radians().cos();
        let w2 = one / (one - e2 * (one - cos_lat * cos_lat));
        let w = w2.sqrt();

        // multipliers for converting longitude and latitude degrees into distance
        let kx = (re * w * cos_lat).to_radians(); // based on normal radius of curvature
        let ky = (re * w * w2 * (one - e2)).to_radians(); // based on meridional radius of curvature

        FlatProjection {
            kx,
            ky,
            lat: latitude,
            lon: longitude,
        }
    }
/// Creates a new `FlatProjection` instance that will work best around
/// the given latitude.
///
/// ```
/// # use flat_projection::FlatProjection;
/// #
/// let proj = FlatProjection::new(7., 51.);
/// ```
Creates a new `FlatProjection` instance that will work best around
the given latitude.


Creates a new ` FlatProjection ` instance that will work best around the given latitude .
pub fn new(longitude: T, latitude: T) -> FlatProjection<T> {
        // see https://github.com/mapbox/cheap-ruler/
        let one = T::one();
        let two = T::from(2).unwrap();
        // Values that define WGS84 ellipsoid model of the Earth
        let re: T = T::from(6378.137).unwrap(); // equatorial radius
        let fe: T = one / T::from(298.257223563).unwrap(); // flattening
        let e2: T = fe * (two - fe);
        // Curvature formulas from https://en.wikipedia.org/wiki/Earth_radius#Meridional
        let cos_lat = latitude.to_radians().cos();
        let w2 = one / (one - e2 * (one - cos_lat * cos_lat));
        let w = w2.sqrt();
        // multipliers for converting longitude and latitude degrees into distance
        let kx = (re * w * cos_lat).to_radians(); // based on normal radius of curvature
        let ky = (re * w * w2 * (one - e2)).to_radians(); // based on meridional radius of curvature
        FlatProjection {
            kx,
            ky,
            lat: latitude,
            lon: longitude,
        }
    }
pub fn new ( longitude : T , latitude : T ) -> FlatProjection < T > { // see https://github.com/mapbox/cheap-ruler/ let one = T :: one ( ) ; let two = T :: from ( 2 ) . unwrap ( ) ; // Values that define WGS84 ellipsoid model of the Earth let re : T = T :: from ( 6378.137 ) . unwrap ( ) ; // equatorial radius let fe : T = one / T :: from ( 298.257223563 ) . unwrap ( ) ; // flattening let e2 : T = fe * ( two - fe ) ; // Curvature formulas from https://en.wikipedia.org/wiki/Earth_radius#Meridional let cos_lat = latitude . to_radians ( ) . cos ( ) ; let w2 = one / ( one - e2 * ( one - cos_lat * cos_lat ) ) ; let w = w2 . sqrt ( ) ; // multipliers for converting longitude and latitude degrees into distance let kx = ( re * w * cos_lat ) . to_radians ( ) ; // based on normal radius of curvature let ky = ( re * w * w2 * ( one - e2 ) ) . to_radians ( ) ; // based on meridional radius of curvature FlatProjection { kx , ky , lat : latitude , lon : longitude , } }
Creates a new `FlatProjection` instance that will work best around
the given latitude.
Creates a new ` FlatProjection ` instance that will work best around the given latitude .
longitude
T
latitude
T
use flat_projection::flatprojection;
None