1
0
mirror of https://github.com/cahirwpz/libnix.git synced 2025-12-08 14:58:56 +00:00
Files
amiga-libnix2/sources/math/trans/atan2.c
2014-01-05 20:02:29 +01:00

13 lines
349 B
C

#include <proto/mathieeedoubtrans.h>
#define PI 3.14159265358979323846
static inline double atan(double x)
{ return IEEEDPAtan(x); }
double atan2(double y,double x)
{ return x>=y?(x>=-y? atan(y/x): -PI/2-atan(x/y)):
(x>=-y? PI/2-atan(x/y):y>=0? PI +atan(y/x):
-PI +atan(y/x));
}