diff options
Diffstat (limited to 'src/slalib/range.f')
-rw-r--r-- | src/slalib/range.f | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/slalib/range.f b/src/slalib/range.f new file mode 100644 index 0000000..a3684cb --- /dev/null +++ b/src/slalib/range.f @@ -0,0 +1,33 @@ + REAL FUNCTION sla_RANGE (ANGLE) +*+ +* - - - - - - +* R A N G E +* - - - - - - +* +* Normalize angle into range +/- pi (single precision) +* +* Given: +* ANGLE dp the angle in radians +* +* The result is ANGLE expressed in the +/- pi (single +* precision). +* +* P.T.Wallace Starlink 23 November 1995 +* +* Copyright (C) 1995 Rutherford Appleton Laboratory +*- + + IMPLICIT NONE + + REAL ANGLE + + REAL API,A2PI + PARAMETER (API=3.141592653589793238462643) + PARAMETER (A2PI=6.283185307179586476925287) + + + sla_RANGE=MOD(ANGLE,A2PI) + IF (ABS(sla_RANGE).GE.API) + : sla_RANGE=sla_RANGE-SIGN(A2PI,ANGLE) + + END |