# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.

# km2deg

Convert spherical distance from kilometers to degrees

## Syntax

```deg = km2deg(km) deg = km2deg(km,radius) deg = km2deg(km,sphere) ```

## Description

`deg = km2deg(km)` converts distances from kilometers to degrees as measured along a great circle on a sphere with a radius of 6371 km, the mean radius of the Earth.

`deg = km2deg(km,radius)` converts distances from kilometers to degrees as measured along a great circle on a sphere having the specified radius. `radius` must be in units of kilometers.

`deg = km2deg(km,sphere)` converts distances from kilometers to degrees, as measured along a great circle on a sphere approximating an object in the Solar System. `sphere` may be one of the following values: `'sun'`, `'moon'`, `'mercury'`, `'venus'`, `'earth'`, `'mars'`, `'jupiter'`, `'saturn'`, `'uranus'`, `'neptune'`, or `'pluto'`, and is case-insensitive.

## Examples

Two cities are 340 km apart. How many degrees of arc is that? How many degrees would it be if the cities were on Mars?

```deg = km2deg(340) deg = 3.0577 deg = km2deg(340,'mars') deg = 5.7465```

## See Also

#### Introduced in R2007a

Was this topic helpful?

Get trial now