Created
July 6, 2017 12:57
-
-
Save erikbern/82e0da684285ec2900fbccc8c6332a10 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 ll_to_3d(lat, lon): | |
lat *= math.pi / 180 | |
lon *= math.pi / 180 | |
x = math.cos(lat) * math.cos(lon) | |
z = math.cos(lat) * math.sin(lon) | |
y = math.sin(lat) | |
return numpy.array([x, y, z]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment