ATAN2

The ATAN2 function expression returns the arc tangent of the expression a1/a2. a1 and a2 themselves may be expressions. The implementation uses the standard C++ function std::atan2(double, double) to compute the numerical value.
- < ATAN2(a1,a2) <
ATAN2(a1,a2) > 0 if a1 > 0
ATAN2(a1,a2) = 0 if a1 = 0, a2 > 0
ATAN2(a1,a2) = if a1 = 0, a2 < 0
ATAN2(a1,a2) < 0 if a1 < 0
ABS(ATAN2(a1,a2))= /2 if a2 = 0
ATAN2(a1,a2) = 0 if a1 = 0, and a2 = 0

Format

ATAN2(a1,a2)

Arguments

 
a1
Any valid function expression.
a2
Any valid function expression.
 
Caution:  
Notice the singular case when a1=0 and a2=0 does not generate a domain error; instead the function returns zero. However, partial derivatives may be infinite potentially causing convergence failures. To alleviate the issue, Adams Solver C++ returns a small quantity for the partial derivatives when the absolute value of both arguments fall below a small threshold. To revert to the behavior prior to version 2016, set the environment variable MSC_ADAMS_SOLVER_STANDARD_ATAN2 to any value.

Examples

VARIABLE/1,
, FUNCTION=ATAN2(DY(21,31,41), DX(21,31,41))
This VARIABLE statement defines an algebraically-determined, user-defined state variable in Adams Solver (C++). Its value is specified by the expression containing ATAN2.
See other FORTRAN 77 intrinsic functions available.