idlastro / Astronomical Utilities: SIXTY

[Source code]

NAME
SIXTY()
PURPOSE
Converts a decimal number to sexagesimal.
EXPLANATION
Reverse of the TEN() function.
CALLING SEQUENCE
X = SIXTY( SCALAR, [ /TrailSign ] ) 
INPUTS
SCALAR -- Decimal quantity.  
OUTPUTS
Function value returned = real vector of three elements, 
sexagesimal equivalent of input decimal quantity.    Double
recision if the input is double, otherwise floating point.
By default, a negative number is signified by making the first non-zero
element of the output vection negative, but this can be modified with
he /TrailSign keyword.
OPTIONAL INPUT KEYWORD
/TrailSign - By default, SIXTY() returns a negative sign in the first
   nonzero element.   If /TrailSign is set, then SIXTY() will return
   always return a negative sign in the first element, even if it is
   zero
PROCEDURE
Mostly involves checking arguments and setting the sign.
EXAMPLE
If x = -0.345d then sixty(x) = [0.0, -20.0, 42.0]
              and sixty(x,/trail) = [-0.0, 20.0, 42.0]
MODIFICATION HISTORY
Written by R. S. Hill, STX, 19-OCT-87         
Output changed to single precision.  RSH, STX, 1/26/88
Accept single element vector   W. Landsman   Sep. 1996
Converted to IDL V5.0   W. Landsman   September 1997
dded /TrailSign keyword, preserve data type  
         B. Stecklum/ W. Landsman   March 2006