Skip to content

Instantly share code, notes, and snippets.

@kristjanmik
Created April 4, 2015 16:17
Show Gist options
  • Save kristjanmik/6925cbefaa311145c58a to your computer and use it in GitHub Desktop.
Save kristjanmik/6925cbefaa311145c58a to your computer and use it in GitHub Desktop.
function WGS84_To_ISN93(l,m){
l = parseFloat(l);
m = parseFloat(m);
var k=l*0.0174532925199433;
var p=0.0818191913305*Math.sin(k);
var o=11616778.382033*Math.pow(Math.tan(0.785398163397448-(k/2))/Math.pow((1-p)/(1+p),0.04090959566525),0.90633380084752);
var q=(m+19)*0.0158185089469038;
return {
x:Math.round((500000+o*Math.sin(q))*1000)/1000,
y:Math.round((3482044.27322585-o*Math.cos(q))*1000)/1000
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment