Mapping Toolbox | ![]() ![]() |
Convert distance from radians to kilometers, nautical miles, or statute miles
Syntax
distout = rad2km(distin) distout = deg2km(distin,radius) distout = rad2nm(distin) distout = rad2nm(distin,radius) distout = rad2sm(distin) distout = rad2sm(distin,radius)
Description
distout = rad2km(distin) converts the input distance given in radians to kilometers.
distout = rad2nm(distin)and distout = rad2sm(distin)work identically, except that the output units are nautical miles and statute miles, respectively.
distout = rad2km(distin,radius)specifies the radius of the sphere to use, since a radian of arc length covers less distance, for example, on Mars than it would on the Earth. You can enter the radius as a number in kilometers, as a call to the almanac
function (e.g., almanac('mars','radius','km')
), again in the appropriate units, or you can pass in a string planet name (e.g., 'mars'
), and the function will make the appropriate call to the almanac
function. The radius of the Earth is the default.
For distout = rad2nm(distin,radius)and distout = rad2sm(distin,radius) make sure your input radius is in the appropriate units, or just use the planet name string.
Examples
How long is a trip around the Equator in statute miles?
See Also
distdim |
Convert distances between different units |
nm2km sm2deg |
Other direct distance conversion functions |
rad2deg |
Convert radians to degrees |
![]() | rad2dms, rad2dm | rc2yx | ![]() |