Mapping Toolbox    

Angles, Times, and Distances - Units and Notation

Angular Notation

Angles can be represented as variables in the Mapping Toolbox in three ways: degrees, radians, and degrees-minutes-seconds. The toolbox provides functions for converting between these formats.

Degrees

This is the default angular unit notation for the toolbox. Although for most scientific applications, radians are more commonly used, in geographic usage, degrees are much more convenient.

Degree notation is simply decimal notation in terms of degrees. Forty-three and one-half degrees would be 43.5.

Radians

Radian notation is simply decimal notation in terms of radians. Two radians would be 2.0.

Degrees-Minutes-Seconds

Degrees-minutes-seconds, or dms, notation is a little more complicated. In text, a dms angle would be ddd° mm' ss''. For example, 142°15'27'' is 142 degrees, 15 minutes, and 27 seconds. There are 60 seconds in a minute and 60 minutes in a degree. In the Mapping Toolbox, when "dms" angles are represented by a single number, the format is dddmm.ss. For example, 142°15'27'' is 14215.27.

The real value of this notation is for the input of data already in this format. The toolbox includes the mat2dms function for easily entering dms data.

A special case of the dms format is the dm format, in which seconds are not included.

If you have a three-column matrix in which the columns are degrees, minutes, and seconds, respectively, mat2dms will convert it to dms format:

Converting Between Angle Unit Formats

The toolbox includes a variety of angle unit conversion functions. For example, to convert the dms format values to degrees or to radians, you can use dms2deg and dms2rad, respectively:

Similar functions include deg2rad, rad2deg, deg2dms, etc. There is also a more general function, angledim, which will convert from one format to another. For example, how many degrees are in radians?

Converting Formatted Angle Strings to Numbers

Many sources of geographic data consist of text with the angles in degrees-minutes-seconds format such as ddd° mm' ss''. These formatted angle strings may include the characters for degrees, minutes and seconds, as well as letters for north, south, east, and west or other special characters. These kinds of angle strings cannot be converted to numbers by using the MATLAB num2str command. However, you can convert many of these string formats to numeric decimal degrees using the str2angle command. The str2angle command accepts string matrices or cell arrays of strings containing values formatted in a number of commonly used angle formats:


  Measuring the Planets Time Notation