next up previous index
Next: B102 Hyperbolic Arcsine Up: CERNLIB Previous: B100 Binomial Coefficient

B101 Arc Tangent Function

Routine ID: B101
Author(s): K.S. KölbigLibrary: MATHLIB
Submitter: Submitted: 15.02.1989
Language: FortranRevised: 15.03.1993

Function subprogram ATG calculates, for real arguments x1 and x2 , (x1,x2) ≠(0.,0.) , an angle α such that

α=arctan(x1/x2)&quad;and&quad;0≤α<2π.

Note that using the Fortran intrinsic function ATAN2 instead of ATG would result in -π<α≤π.

Structure:

FUNCTION subprogram

User Entry Names: ATG

Usage:

In any arithmetic expression, ATG(X1,X2)

has the value of α (in radians). ATG, X1 and X2 are of type REAL.

Notes:

This function subprogram is equivalent to the statement function ATG(X1,X2)=ATAN2(X1,X2)+(PI-SIGN(PI,X1))

where PI = π .

B102


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995