Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2014
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function fromLatLngToPoint(location)
  2. {
  3.     var c= {};
  4.     c.x = 128 + location.Longitude*0.7111111111111111;
  5.     var e=Td(Math.sin(Wd(location.Latitude)),-(1-1E-15),1-1E-15);
  6.     c.y=128+.5*Math.log((1+e)/(1-e))*-40.74366543152521;
  7.     return c;
  8. }
  9.  
  10. function fromPointToLatLng(point)
  11. {
  12.     return {
  13.         Latitude : Xd(2*Math.sqrt(Math.exp((point.y-128)/-40.74366543152521)) - Math.PI/2),
  14.         Longitude : (point.x-128)/0.7111111111111111
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement