标签:style blog color sp div on c log r
//经纬度转Web墨卡托 dvec3 CMathEngine::lonLat2WebMercator(dvec3 lonLat) { dvec3 mercator; double x = lonLat.x *20037508.34/180; double y = log(tan((90+lonLat.y)*PI/360))/(PI/180); y = y *20037508.34/180; mercator.x = x; mercator.y = y; return mercator; } //Web墨卡托转经纬度 dvec3 CMathEngine::WebMercator2lonLat( dvec3 mercator ) { dvec3 lonLat; double x = mercator.x/20037508.34*180; double y = mercator.y/20037508.34*180; y= 180/PI*(2*atan(exp(y*PI/180))-PI/2); lonLat.x = x; lonLat.y = y; return lonLat; }
标签:style blog color sp div on c log r
原文地址:http://www.cnblogs.com/liuswi/p/3998073.html