Created
March 19, 2018 04:26
-
-
Save anonymous/3c82d80547d3ed26baf5d87f85855198 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function merc(lat, lon) { | |
let r_major = 6378137.000, | |
x = r_major * toRadians(lon), | |
scale = x/lon, | |
y = 180.0/Math.PI * Math.log(Math.tan(Math.PI/4.0 + lat * (Math.PI/180.0)/2.0)) * scale; | |
return (x, y) | |
} | |
function toRadians (angle) { | |
return angle * (Math.PI / 180); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment