zoukankan      html  css  js  c++  java
  • Web墨卡托坐标与WGS84坐标互转

    //经纬度转墨卡托
    -(CGPoint
    )lonLat2Mercator:(CGPoint ) lonLat
    {
        CGPoint  mercator;
        double
    x = lonLat.x *20037508.34/180;
        double y =
    log(tan((90+lonLat.y)*M_PI/360))/(M_PI/180);
        y = y *20037508.34/180;
     
      mercator.x = x;
        mercator.y = y;
        return mercator
    ;
    }
    //墨卡托转经纬度
    -(CGPoint )Mercator2lonLat:(CGPoint ) mercator
    {
     
      CGPoint lonLat;
        double x = mercator.x/20037508.34*180;
        double y
    = mercator.y/20037508.34*180;
        y=
    180/M_PI*(2*atan(exp(y*M_PI/180))-M_PI/2);
        lonLat.x = x;
        lonLat.y
    = y;
        return lonLat;
    }
  • 相关阅读:
    POJ 1045
    POJ 1051
    POJ 1047
    POJ 1050
    POJ 1046
    POJ 1036
    POJ 1035
    POJ 1032
    【洛谷P1412】经营与开发
    【洛谷P3377】【模板】左偏树(可并堆)
  • 原文地址:https://www.cnblogs.com/tuncaysanli/p/2701118.html
Copyright © 2011-2022 走看看