--- ray/src/common/rtmath.h 2003/07/12 09:56:24 3.2 +++ ray/src/common/rtmath.h 2021/12/13 21:05:00 3.15 @@ -1,20 +1,19 @@ -/* RCSid $Id: rtmath.h,v 3.2 2003/07/12 09:56:24 schorsch Exp $ */ +/* RCSid $Id: rtmath.h,v 3.15 2021/12/13 21:05:00 greg Exp $ */ /* * Header for Radiance vector and math routines */ #ifndef _RAD_RTMATH_H_ #define _RAD_RTMATH_H_ -#ifdef __cplusplus -extern "C" { -#endif #include -#include "tifftypes.h" - +#include "tiff.h" /* needed for int32, etc. */ #include "mat4.h" +#ifdef __cplusplus +extern "C" { +#endif /* regular transformation */ typedef struct { MAT4 xfm; /* transform matrix */ @@ -33,18 +32,19 @@ typedef struct { #define PI 3.14159265358979323846 #endif #endif + /* defined in tcos.c */ +extern double tcos(double x); +extern double atan2a(double y, double x); -#ifdef FASTMATH +#ifdef __FAST_MATH__ #define tcos cos #define tsin sin #define ttan tan #else - /* table-based cosine approximation */ + /* table-based approx in tcos.c */ #define tsin(x) tcos((x)-(PI/2.)) #define ttan(x) (tsin(x)/tcos(x)) #endif - /* defined in tcos.c */ -extern double tcos(double x); /* defined in xf.c */ extern int xf(XF *ret, int ac, char *av[]); extern int invxf(XF *ret, int ac, char *av[]); @@ -61,4 +61,3 @@ extern double fdir2diff(int32 dc1, FVECT v2); } #endif #endif /* _RAD_RTMATH_H_ */ -