7 |
|
|
8 |
|
#include "copyright.h" |
9 |
|
|
10 |
+ |
#define _USE_MATH_DEFINES |
11 |
|
#include <math.h> |
12 |
|
#include "fvect.h" |
13 |
|
|
14 |
+ |
double |
15 |
+ |
Acos(double x) /* insurance for touchy math library */ |
16 |
+ |
{ |
17 |
+ |
if (x <= -1.+FTINY*FTINY) |
18 |
+ |
return(M_PI); |
19 |
+ |
if (x >= 1.-FTINY*FTINY) |
20 |
+ |
return(.0); |
21 |
+ |
return(acos(x)); |
22 |
+ |
} |
23 |
+ |
|
24 |
+ |
double |
25 |
+ |
Asin(double x) /* insurance for touchy math library */ |
26 |
+ |
{ |
27 |
+ |
if (x <= -1.+FTINY*FTINY) |
28 |
+ |
return(-M_PI/2.); |
29 |
+ |
if (x >= 1.-FTINY*FTINY) |
30 |
+ |
return(M_PI/2); |
31 |
+ |
return(asin(x)); |
32 |
+ |
} |
33 |
|
|
34 |
|
double |
35 |
|
fdot( /* return the dot product of two vectors */ |