iOS 火星坐标(GCJ-02) 转化为百度坐标(BD-09)

+(NSString *)MarsCoordinatesHX_lat:(double )newHX_lat HX_lon:(double )newHX_lon{
    double x = newHX_lat, y = newHX_lon;
    double z = sqrt(x * x + y * y) + 0.00002 * sin(y * x_pi);
    double theta = atan2(y, x) + 0.000003 * cos(x * x_pi);
    double bd_lon = z * cos(theta) + 0.0065;
    double bd_lat = z * sin(theta) + 0.006;
    
    NSString *point=[NSString stringWithFormat:@"%f,%f",bd_lon,bd_lat];
    
    return point;
}

 

 

posted @ 2014-05-26 11:19  橙子哥哥  阅读(185)  评论(0)    收藏  举报