Skip to content

Instantly share code, notes, and snippets.

@tmcw
Created October 18, 2013 20:31
Show Gist options
  • Save tmcw/7047774 to your computer and use it in GitHub Desktop.
Save tmcw/7047774 to your computer and use it in GitHub Desktop.
function fx(x, y) {
// Cassini projection
// just a transverse equirectangular projection
// implemented from wikipedia description
d2r = Math.PI / 180;
return Math.asin(Math.sin(x * d2r) * Math.cos(y * d2r));}
function fy(x, y) {
return Math.atan2(Math.sin(y * d2r),
Math.cos(y * d2r) * Math.cos(x * d2r));}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment