Created
July 15, 2016 12:20
-
-
Save mainvoid007/957bd0b9c03771199630bb2afe50f8cd 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
def pol2latlon(x,y): | |
R = 6370.04 | |
lam0 = math.radians(10); | |
phi0 = math.radians(60); | |
lam = np.arctan(x*-1 / y) + lam0 | |
z = math.pow(R,2) * math.pow(1+np.sin(phi0),2) - (math.pow(x,2) + math.pow(y,2)) | |
n = math.pow(R,2) * math.pow(1+np.sin(phi0),2) + (math.pow(x,2) + math.pow(y,2)) | |
phi = np.arcsin(z/n) | |
return (math.degrees(lam), math.degrees(phi)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment