# Math Help - Convert Cartesian Distance to Sperical

1. ## Convert Cartesian Distance to Sperical

I apologize if this is posted in the in the wrong place (i figure either here or calculus)

this is what i know - I have a latitude and longitude and I can convert these to Cartesian coordinates like this

first convert lat and lon to radians by multiplying by pi/180, then

$x = cos(lat) * cos(lon)$

$y = cos(lat) * sin(lon)$

$z = sin(lat)$

To convert back to lat lon i do this

$r=\sqrt(x^2 + y^2 + z^2)$

$lat = asin(z/r)*(180/pi)$
$lon = atan2(y, x)*(180/pi)$

What I am trying to figure out is

If i give you a distance between two points defined in cartesian space on a unit radius sphere how do i convert that distance to lat lon in degrees

Hope this makes some sense

Chogo