Functions for angle transformations and manipulations, with angles generally in degrees. In particular, methods for translating between degrees and HH:MM:SS.S or DDD:MM:SS.S type sexagesimal representations are provided.
degreesToDms( deg )
deg
(floating point): angle in degreesdeg
degreesToDms( deg, secFig )
deg
(floating point): angle in degreessecFig
(integer): number of decimal places in the seconds fielddeg
degreesToHms( deg )
deg
(floating point): angle in degreesdeg
degreesToHms( deg, secFig )
deg
(floating point): angle in degreessecFig
(integer): number of decimal places in the seconds fielddeg
dmsToDegrees( dms )
dm[s]
, or some others.
Additional spaces and leading +/- are permitted.
The :seconds part is optional.
dms
(String): formatted DMS stringdms
hmsToDegrees( hms )
hm[s]
, or some others.
Additional spaces and leading +/- are permitted.
The :seconds part is optional.
hms
(String): formatted HMS stringhms
dmsToDegrees( deg, min, sec )
In conversions of this type, one has to be careful to get the
sign right in converting angles which are between 0 and -1 degrees.
This routine uses the sign bit of the deg
argument,
taking care to distinguish between +0 and -0 (their internal
representations are different for floating point values).
It is illegal for the min
or sec
arguments
to be negative.
deg
(floating point): degrees part of anglemin
(floating point): minutes part of anglesec
(floating point): seconds part of anglehmsToDegrees( hour, min, sec )
In conversions of this type, one has to be careful to get the
sign right in converting angles which are between 0 and -1 hours.
This routine uses the sign bit of the hour
argument,
taking care to distinguish between +0 and -0 (their internal
representations are different for floating point values).
hour
(floating point): degrees part of anglemin
(floating point): minutes part of anglesec
(floating point): seconds part of angleskyDistanceDegrees( ra1, dec1, ra2, dec2 )
ra1
(floating point): right ascension of point 1 in degreesdec1
(floating point): declination of point 1 in degreesra2
(floating point): right ascension of point 2 in degreesdec2
(floating point): declination of point 2 in degreesposAngDegrees( ra1, dec1, ra2, dec2 )
ra1
(floating point): right ascension of point 1 in degreesdec1
(floating point): declination of point 1 in degreesra2
(floating point): right ascension of point 2 in degreesdec2
(floating point): declination of point 2 in degreespolarDistanceDegrees( ra1, dec1, radius1, ra2, dec2, radius2 )
ra1
(floating point): right ascension of point 1 in degreesdec1
(floating point): declination of point1 in degreesradius1
(floating point): distance from origin of point1ra2
(floating point): right ascension of point 2 in degreesdec2
(floating point): declination of point2 in degreesradius2
(floating point): distance from origin of point2radius1
and radius2