Learn R Programming

astroFns (version 4.2-1)

dms2rad: Degrees, minutes, and seconds to radians

Description

Angular conversion from degrees, minutes, and seconds to radians

Usage

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

Arguments

d

String containing degrees, minutes, and seconds

Value

Angle in radians

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.

See Also

hms2rad, rad2dms, rad2hms

Examples

Run this code
# NOT RUN {
dms2rad('10, 22, 14')
dms2rad('10:22:14')
dms2rad('10d22m14s')
dms2rad('-0, 30')
dms2rad('-77d30.5m')
dms2rad('W 77d30.5m')
dms2rad(-77.5083333)
# }

Run the code above in your browser using DataLab