Documentation

This is machine translation

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

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

Lengths and Angles

Convert between different angle and length units and perform longitude wrapping; convert units of distances along the surface of the Earth

Functions

deg2rad Convert angle from degrees to radians
rad2deg Convert angle from radians to degrees
degrees2dm Convert degrees to degrees-minutes
degrees2dms Convert degrees to degrees-minutes-seconds
dm2degrees Convert degrees-minutes to degrees
dms2degrees Convert degrees-minutes-seconds to degrees
toDegrees Convert angles to degrees
toRadians Convert angles to radians
fromDegrees Convert angles from degrees
fromRadians Convert angles from radians
km2nm Convert kilometers to nautical miles
km2sm Convert kilometers to statute miles
nm2km Convert nautical miles to kilometers
nm2sm Convert nautical to statute miles
sm2km Convert statute miles to kilometers
sm2nm Convert statute to nautical miles
wrapTo180 Wrap angle in degrees to [-180 180]
wrapTo360 Wrap angle in degrees to [0 360]
wrapToPi Wrap angle in radians to [−pi pi]
wrapTo2Pi Wrap angle in radians to [0 2*pi]
unwrapMultipart Unwrap vector of angles with NaN-delimited parts
str2angle Convert text to angles in degrees
map.geodesy.isdegree True if input matches'degree' and false if 'radian'
validateLengthUnit Validate and standardize length unit
unitsratio Unit conversion factors
deg2km Convert spherical distance from degrees to kilometers
deg2nm Convert spherical distance from degrees to nautical miles
deg2sm Convert spherical distance from degrees to statute miles
km2deg Convert spherical distance from kilometers to degrees
km2rad Convert spherical distance from kilometers to radians
nm2deg Convert spherical distance from nautical miles to degrees
nm2rad Convert spherical distance from nautical miles to radians
rad2km Convert spherical distance from radians to kilometers
rad2nm Convert spherical distance from radians to nautical miles
rad2sm Convert spherical distance from radians to statute miles
sm2deg Convert spherical distance from statute miles to degrees
sm2rad Convert spherical distance from statute miles to radians

Examples and How To

Convert from Linear Measurements to Spherical Measurements

This example shows how to convert distances along the surface of the Earth from linear units to angular units.

Compute Conversion Ratio Between Units of Length

This example shows how to create a conversion factor for many different units of length using the unitsratio function.

Concepts

Angles

Working with Angles: Units and Representations

Angles specify the position and distance of geospatial objects.

Angles as Binary and Formatted Numbers

Angles are traditionally formatted in decimal degrees for mapping applications.

Lengths

Working with Length and Distance Units

Linear measurements of lengths on spheroids use the same units they do on the plane.

Positions, Azimuths, Headings, Distances, Length, and Ranges

Several angular and linear quantities express the distance between two points on a sphere.

Spherical Distance

Working with Distances on the Sphere

Distances on the sphere are represented by both angles and arc lengths.

Was this topic helpful?