Convert spherical distance from radians to kilometers
Convert Radians to Kilometers on Earth
Find the circumference of the Earth in kilometers. By default, the
rad2km function assumes your input is a measurement of the Earth, which is represented as sphere with a radius of 6371 kilometers.
km = rad2km(2*pi)
km = 4.0030e+04
Convert Radians to Kilometers on Mars
Find the circumference of Mars in kilometers.
km = rad2km(2*pi,'mars')
km = 2.1300e+04
rad — Distance in radians
Distance in radians, specified as a numeric array.
km — Distance in kilometers
Distance in kilometers, returned as a numeric array.
Introduced in R2007a