| 5 |
|
|
| 6 |
|
#ifndef _RAD_RTMATH_H_ |
| 7 |
|
#define _RAD_RTMATH_H_ |
| 8 |
– |
#ifdef __cplusplus |
| 9 |
– |
extern "C" { |
| 10 |
– |
#endif |
| 8 |
|
|
| 9 |
|
#include <math.h> |
| 10 |
|
|
| 11 |
< |
#include "tifftypes.h" |
| 15 |
< |
|
| 11 |
> |
#include "tiff.h" /* needed for int32, etc. */ |
| 12 |
|
#include "mat4.h" |
| 13 |
|
|
| 14 |
+ |
#ifdef __cplusplus |
| 15 |
+ |
extern "C" { |
| 16 |
+ |
#endif |
| 17 |
|
/* regular transformation */ |
| 18 |
|
typedef struct { |
| 19 |
|
MAT4 xfm; /* transform matrix */ |
| 32 |
|
#define PI 3.14159265358979323846 |
| 33 |
|
#endif |
| 34 |
|
#endif |
| 35 |
+ |
/* defined in tcos.c */ |
| 36 |
+ |
extern double tcos(double x); |
| 37 |
+ |
extern double atan2a(double y, double x); |
| 38 |
|
|
| 39 |
< |
#ifdef FASTMATH |
| 39 |
> |
#ifdef __FAST_MATH__ |
| 40 |
|
#define tcos cos |
| 41 |
|
#define tsin sin |
| 42 |
|
#define ttan tan |
| 45 |
|
#define tsin(x) tcos((x)-(PI/2.)) |
| 46 |
|
#define ttan(x) (tsin(x)/tcos(x)) |
| 47 |
|
#endif |
| 48 |
< |
/* defined in tcos.c */ |
| 49 |
< |
extern double tcos(double x); |
| 48 |
> |
|
| 49 |
> |
/* VC 2015 has those defined (XXX possibly earlier?) */ |
| 50 |
> |
#if ((defined(_WIN32) || defined(_WIN64)) \ |
| 51 |
> |
&& (!defined(_MS_VER) || _MS_VER < 1900)) |
| 52 |
> |
extern double erf(double x); |
| 53 |
> |
extern double erfc(double x); |
| 54 |
> |
#endif |
| 55 |
|
/* defined in xf.c */ |
| 56 |
|
extern int xf(XF *ret, int ac, char *av[]); |
| 57 |
|
extern int invxf(XF *ret, int ac, char *av[]); |
| 58 |
|
extern int fullxf(FULLXF *fx, int ac, char *av[]); |
| 59 |
|
/* defined in zeroes.c */ |
| 60 |
< |
extern int quadtratic(double *r, double a, double b, double c); |
| 60 |
> |
extern int quadratic(double *r, double a, double b, double c); |
| 61 |
|
/* defined in dircode.c */ |
| 62 |
|
extern int32 encodedir(FVECT dv); |
| 63 |
|
extern void decodedir(FVECT dv, int32 dc); |