Skip to content

Instantly share code, notes, and snippets.

@tmn
Created February 19, 2014 11:45
Show Gist options
  • Save tmn/9090407 to your computer and use it in GitHub Desktop.
Save tmn/9090407 to your computer and use it in GitHub Desktop.
sub convertLon {
my $lon = sprintf "%.6f", ((shift) / (2 * pi * 6378137 / 2)) * 180;
}
sub convertLat {
my $lat = ((shift) / (2 * pi * 6378137 / 2)) * 180;
$lat = sprintf "%.6f", 180 / pi * (2 * atan(exp($lat * pi / 180)) - pi / 2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment