# Convert geocentric distance from center of earth to geocentric altitude

I was using Satellite Toolbox for using Jacchia Bowman 2008 atmospheric model. JB2008 model considers latitude, longitude and altitude in geocentric co-ordinate as input , but the satellite data I have is in Geodetic co-ordinate. There is a package in Satellite toolbox to convert the geodetic co-ordinates to geocentric co-ordinates, but that gives the height as a distance from center of earth. Can anybody tell me how can I convert geocentric distance from center of earth to geocentric altitude above the surface?

for i = 1:len
A = GeodetictoGeocentric(deg2rad(Data.LAT[i]),Data.ALT[i]); #inputs are in geodetic cordinate
GLAT[i] = A; #geocentric latitude
GALT[i] = A; #geocentric distance
end
If anybody knows any workaround, that will also be appreciated.

My naive way of doing this would be to convert the geodetic to cartesian (ECEF) coordinates, scale them until they are on the Earth ellipsoid and the distance between the original and scaled coords would be the geocentric height above ellipsoid. But this involves writing a bit of code to do the scaling, so if you think this is a useful approach then I can paste the scaling code that I use (which uses the WGS 84 ellipsoid).

Would it be alright to subtract the latitude-dependent Earth radius from the distance you obtained from the center of the Earth?

The Earth geocentric radius at geodetic latitude φ is given by:

where `a = 6,378 km` is the equatorial radius, and `b = 6,357 km` is the polar radius.

1 Like

Thanks for your answer rafael. Can you quote the source you got this equation from?

@sxd190026, updated link in post above.

thanks a lot rafael

Check out ERFA.jl. It has a number of functions for doing these kinds of conversions.

1 Like