Degrees, minutes, and seconds to radians

Share:

Description

Angular conversion from degrees, minutes, and seconds to radians

Usage

1
dms2rad(d = '33d 09m 35.0s')

Arguments

d

String containing degrees, minutes, and seconds

Details

Function reads a string (the input is a string to allow conversion of angles between -1 and zero degrees) with degrees, minutes, and seconds separated by any of characters d, m, s, a colon, or a comma. Spaces are not valid separators, as they are removed as part of input parsing. Decimal values are allowed in any position. Zeros are the default if values for minutes or seconds are missing from the string. A minus sign, W, or w before the degrees indicates negative degrees. Positive degrees are denoted by no character, +, E, or e before the degrees values.

Value

Angle in radians

Author(s)

Andrew Harris

See Also

hms2rad, rad2dms, rad2hms

Examples

1
2
3
4
5
6
7
dms2rad('10, 22, 14')
dms2rad('10:22:14')
dms2rad('10d22m14s')
dms2rad('-0, 30')
dms2rad('-77d30.5m')
dms2rad('W 77d30.5m')
dms2rad(-77.5083333)