home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / dev / gcc / libnixV0_8.lha / gnu / libnix-sources.lha / sources / math / trans / atan2.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-12  |  373 b   |  15 lines

  1. #ifdef __GNUC__
  2. #include <inline/mathieeedoubtrans.h>
  3. #endif
  4.  
  5. #define PI 3.14159265358979323846
  6.  
  7. static inline double atan(double x)
  8. { return IEEEDPAtan(x); }
  9.  
  10. double atan2(double y,double x)
  11. { return x<=y?(x>=-y?      atan(y/x):     -PI/2-atan(x/y)):
  12.               (x>=-y? PI/2-atan(x/y):y>=0? PI  +atan(y/x):
  13.                                           -PI  +atan(y/x));
  14. }
  15.