Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 18789

Can we convert longitude and latitude to cartesian co-ordinates without elevation?

$
0
0

Can I convert from longitude/latitude (x,y) coordinates to cartesian (x,y,z) without having elevation. I have checked some forms discussing converting longitude/latitude into cartesian coordinates, and here's the code in python.

    R = numpy.float64(6371000)  # in meters    longitude = numpy.float64(lon)    latitude = numpy.float64(lat)    X = R * math.cos(longitude) * math.sin(latitude)    Y = R * math.sin(latitude) * math.sin(longitude)    Z = R * math.cos(latitude)

Problem Statement: I have data gathered from different locations. However, these locations are in longitude and latitude format. Are these two attributes are enough to convert the locations into cartesian format ?. Is the code above is correct ?


Viewing all articles
Browse latest Browse all 18789

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>