Convert spherical distance from degrees to kilometers
Convert Degrees to Kilometers on Earth
Find the circumference of the Earth in kilometers. By default, the
deg2km function assumes your input is a measurement of the Earth, which is represented as a sphere with a radius of 6371 kilometers.
km = deg2km(360)
km = 4.0030e+04
Convert Degrees to Kilometers on Mars
Find the circumference of Mars in kilometers.
km = deg2km(360,'mars')
km = 2.1300e+04
deg — Distance in degrees
Distance in degrees, specified as a numeric array.
km — Distance in kilometers
Distance in kilometers, returned as a numeric array.