1
/* @(#)trigo.h 19.1 (ESO-IPG) 02/25/03 13:49:44 */
5
.AUTHOR Francois Ochsenbein [ESO-IPG]
6
.KEYWORDS Trigonometric mathematical functions
7
.COMMENTS This header contains declarations for mathematical functions
8
and macros for spherical/hyperbolic transformations.
10
.VERSION 1.0 21-Oct-1985: Creation
11
.VERSION 1.1 05-Dec-1988: Transformed some macros to functions
17
#include <math.h> /* Use system Math Library */
18
#include <compiler.h> /* If function templates are allowed */
20
/* CG 930916: PI is defined in math.h(Linux) */
22
#define PI 3.14159265358979325e0
25
#define DEG (180.e0/PI) /* radians to degrees */
26
/* =57.295779513082320e0 */
28
/*=========================================================================
29
1. Trigonometric functions
30
*=========================================================================*/
32
/* Standard: sin(x) cos(x) tan(x) sinh(x) cosh(x) tanh(x) */
34
/* Argument in degrees: */
38
double cosd (double x);
39
double sind (double x);
40
double tand (double x);
41
double acosd(double x);
42
double asind(double x);
43
double atand(double x);
44
double atan2d(double x, double y);
46
double acosd(), asind(), atand(), atan2d();
47
double cosd(), sind(), tand();
50
/*=========================================================================
51
2. Spherical functions
52
*=========================================================================*/
55
int tr_ou (double o[2] , double u[3]);
56
int tr_uo (double u[3] , double o[2]);
57
/* Surface of a `rectangle' on the sphere */
58
double surf_o (double o1[2], double o2[2]); /* Pos. in degrees */
59
double surf_p (double p1[2], double p2[2]); /* On gnomonic proj. */
60
/* Distances between two points on the sphere (degrees) */
61
double s2d_u (double u1[3], double u2[3]);
62
double s2d_o (double o1[2], double o2[2]);
63
double s2d_p (double p1[2], double p2[2]);
64
double dist_u (double u1[3], double u2[3]);
65
double dist_o (double o1[2], double o2[2]);
66
double dist_p (double p1[2], double p2[2]);
68
double surf_o(), surf_p();
69
double s2d_o(), s2d_p(), s2d_u();
70
double dist_o(), dist_p(), dist_u();
73
/*=========================================================================
74
3. Other standard Math Functions
75
*=========================================================================*/
77
/* Standard: atof(x) log(x) log10(x) exp(x) sqrt(x) */
78
/* Standard: hypoth(x,y)= sqrt(x*x + y*y) */
79
/* Standard: pow(x,y) = x**y */
82
double sinc (double x); /* sin(x)/x */
83
double asinc(double x); /* asin(x)/x */
84
double acosh(double x);
85
double asinh(double x);
86
double atanh(double x);
88
double sinc(), asinc();
89
double acosh(), asinh(), atanh();
94
/*=========================================================================
95
4. Arithmetic operations
96
*=========================================================================*/
98
/* Standard: ceil(x) floor(x) fabs(x) */
99
/* Standard: fmod(x,y) = x%y, with same sign as x */
101
/* trigo functions in degrees*/
102
/*=========================================================================
103
5. Mantissa / Exponent Conversions
104
*=========================================================================*/
106
/* Standard: m = frexp (x, &e) Returns m and e such that x = m * 2**e
107
with |m| in range [0.5, 1[ */
108
/* Standard: y = ldexp (m, e) Returns y = m * 2**e */
109
/* Standard: f = modf (x, &E) Returns f and E (double) with x = E + f
110
f = fractional part with same