Created
September 28, 2012 18:02
-
-
Save george-silva/3801297 to your computer and use it in GitHub Desktop.
Conversão PTL
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
@staticmethod | |
def para_ptl(xo,yo,zo,lato,lono,x_geoc,y_geoc,z_geoc): | |
""" | |
xo,yo,zo = origem geocentrica; | |
lato,lono = origem em lat long; | |
x_geoc,y_geoc,z_geoc = ponto a ser convertido; | |
""" | |
rlat = radians(lato) | |
rlot = radians(lono) | |
xp = (-1 * (x_geoc - xo)) * sin(rlot) + (y_geoc - yo) * cos(rlot) | |
yp = (-1 * (x_geoc - xo)) * cos(rlot)*sin(rlat) - (y_geoc - yo) * sin(rlat)*sin(rlot) + (z_geoc - zo) * cos(rlat) | |
zp = (x_geoc - xo) * cos(rlat) * cos(rlot) + (y_geoc - yo) * cos(rlat) * sin(rlot) + (z_geoc - zo) * sin(rlat) | |
return Point(x=xp,y=yp,z=zp,srid=-1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment