fn to_mercator(&self, lat: f64, long: f64) -> (f64, f64) {
        let scale: f64 = self.scale * scale::DEFAULT;

        let x = (long + 180.0) * (scale / 360.0);
        let lat_rad = lat.to_radians();
        let merc_n = f64::ln(f64::tan((std::f64::consts::PI / 4.0) + (lat_rad / 2.0)));
        let y = (scale / 2.0) - (scale * merc_n / (2.0 * std::f64::consts::PI));

        (x, y)
    }
/// Convert lat/long to mercator coordinates
Convert lat/long to mercator coordinates
Convert lat / long to mercator coordinates
fn to_mercator(&self, lat: f64, long: f64) -> (f64, f64) {
        let scale: f64 = self.scale * scale::DEFAULT;
        let x = (long + 180.0) * (scale / 360.0);
        let lat_rad = lat.to_radians();
        let merc_n = f64::ln(f64::tan((std::f64::consts::PI / 4.0) + (lat_rad / 2.0)));
        let y = (scale / 2.0) - (scale * merc_n / (2.0 * std::f64::consts::PI));
        (x, y)
    }
fn to_mercator ( & self , lat : f64 , long : f64 ) -> ( f64 , f64 ) { let scale : f64 = self . scale * scale :: DEFAULT ; let x = ( long + 180.0 ) * ( scale / 360.0 ) ; let lat_rad = lat . to_radians ( ) ; let merc_n = f64 :: ln ( f64 :: tan ( ( std :: f64 :: consts :: PI / 4.0 ) + ( lat_rad / 2.0 ) ) ) ; let y = ( scale / 2.0 ) - ( scale * merc_n / ( 2.0 * std :: f64 :: consts :: PI ) ) ; ( x , y ) }
Convert lat/long to mercator coordinates
Convert lat / long to mercator coordinates
&self
lat
f64
long
f64
&self
lat
f64
long
f64