Convert degrees, arcminutes and arcseconds to decimal degrees

Description

Convert a signed field angle in degrees, minutes and seconds to decimal degrees for coordinate and orientation calculations.

Usage

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

Arguments

dd

Degrees as a finite numeric scalar, or a single character string containing an angle, for example "-8:30:00".

mm

Arcminutes as a finite numeric scalar. Defaults to zero.

ss

Arcseconds as a finite numeric scalar. Defaults to zero.

Details

The sign applies to the whole angle. The magnitude is the sum of absolute degrees, minutes divided by 60 and seconds divided by 3600. With numeric components the first nonzero component sets the sign and later components must be nonnegative. A string may contain one to three colon- or space-separated components and an optional leading sign. A string such as "-0:30" preserves the negative sign even when degrees are zero.

Value

A numeric scalar giving the angle in signed decimal degrees.

Validation

Build 2.0.9005 passed all 499 calendar, clock, era, angle and setting checks in A01. The largest discrepancy across 240 absolute Julian dates was 0.000021 seconds. See A01 validation in the technical manual.

Scientific checks

See Also

reduct.compass, reduct.theodolite, mag.dec, sunAz, az2dec

Examples

ten(24, 52, 16)
ten(-8, 30, 0)     # -8.5 degrees
ten(0, -30, 0)     # -0.5 degrees
ten(0, 0, -30)     # -1/120 degrees
ten("-8:30:00")    # -8.5 degrees
ten("-0:30:00")    # Preserve the minus sign when degrees are zero