Learn R Programming

astrolibR (version 0.1)

ten: Convert a sexigesimal number or string to decimal

Description

Convert a sexigesimal number or string to decimal

Usage

ten(dd, mm=0, ss=0)

Arguments

dd
degrees (0-360) or hour (0-24), integer, scalar or string giving sexigesimal quantity separated by spaces or colons; e.g.. "10 23 34" or "-3:23:45.2".
mm
minutes, integer (0-60), scalar (default = 0)
ss
seconds, integer (0-60), scalar (default = 0)

Value

decimal equivalent of input sexigesimal quantity, real, scalar

Details

The output is a real number
= dd + mm/60. + ss/3600
. Inverse of the sixty function. The function tenv can be used when dealing with a vector of sexigesimal quantities.

See Also

sixty

Examples

Run this code
ten(12,0,0)   # gives 12
ten("12:00:00")   # gives 12
ten(0,-23,34)  # gives -0.39277778
ten("-0:23:34")   # gives -0.39277778

Run the code above in your browser using DataLab