ten: Convert a sexigesimal number or string to decimal

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Convert a sexigesimal number or string to decimal

Usage

1
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)

Details

The output is a real number

1
= dd + mm/60. + ss/3600

. Inverse of the sixty function. The function tenv can be used when dealing with a vector of sexigesimal quantities.

Value

decimal equivalent of input sexigesimal quantity, real, scalar

Author(s)

Written W. Landsman Raytheon ITSS 2000

R adaptation by Arnab Chakraborty June 2013

See Also

sixty

Examples

1
2
3
4
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

Example output

[1] 12
[1] 12
[1] 0.3927778
[1] -0.3927778

astrolibR documentation built on May 2, 2019, 3:26 a.m.