MATLAB: Does KM2DEG return inaccurate results in the Mapping Toolbox 2.7.1 (R2008b)

azimuthdegreeskilometerslatitudelongitudeMapping Toolbox

When I use KM2DEG, I get angles that are slightly different from what I expect. I use the command with the following syntax:
dataDeg = km2deg(dataKm);

Best Answer

If called with only one argument, the function KM2DEG assumes that the radius of the Earth is exactly 6371 km, which may not be what you expect. To specify you own value for the radius of the Earth, you can pass it as a second argument to the KM2DEG function as follows:
% Pass radius in units of km
dataDeg = km2deg(dataKm, 6378.135);