summaryrefslogtreecommitdiff
path: root/gsl-1.9/doc/specfunc-trig.texi
blob: 547b2a156edf065d3f45d9f3f91eb023ed2e9f03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
@cindex trigonometric functions

The library includes its own trigonometric functions in order to provide
consistency across platforms and reliable error estimates.  These
functions are declared in the header file @file{gsl_sf_trig.h}.

@menu
* Circular Trigonometric Functions::  
* Trigonometric Functions for Complex Arguments::  
* Hyperbolic Trigonometric Functions::  
* Conversion Functions::        
* Restriction Functions::       
* Trigonometric Functions With Error Estimates::  
@end menu

@node Circular Trigonometric Functions
@subsection Circular Trigonometric Functions

@deftypefun double gsl_sf_sin (double @var{x})
@deftypefunx int gsl_sf_sin_e (double @var{x}, gsl_sf_result * @var{result})
@cindex sine function, special functions
These routines compute the sine function @math{\sin(x)}.
@comment Exceptional Return Values:
@end deftypefun

@deftypefun double gsl_sf_cos (double @var{x})
@deftypefunx int gsl_sf_cos_e (double @var{x}, gsl_sf_result * @var{result})
@cindex cosine function, special functions
These routines compute the cosine function @math{\cos(x)}.
@comment Exceptional Return Values:
@end deftypefun

@deftypefun double gsl_sf_hypot (double @var{x}, double @var{y})
@deftypefunx int gsl_sf_hypot_e (double @var{x}, double @var{y}, gsl_sf_result * @var{result})
@cindex hypot function, special functions
These routines compute the hypotenuse function @c{$\sqrt{x^2 + y^2}$}
@math{\sqrt@{x^2 + y^2@}} avoiding overflow and underflow.
@comment Exceptional Return Values:
@end deftypefun

@deftypefun double gsl_sf_sinc (double @var{x})
@deftypefunx int gsl_sf_sinc_e (double @var{x}, gsl_sf_result * @var{result})
@cindex complex sinc function, special functions
These routines compute @math{\sinc(x) = \sin(\pi x) / (\pi x)} for any
value of @var{x}.
@comment Exceptional Return Values: none
@end deftypefun

@node Trigonometric Functions for Complex Arguments
@subsection Trigonometric Functions for Complex Arguments

@deftypefun int gsl_sf_complex_sin_e (double @var{zr}, double @var{zi}, gsl_sf_result * @var{szr}, gsl_sf_result * @var{szi})
@cindex complex sine function, special functions
This function computes the complex sine, @math{\sin(z_r + i z_i)} storing
the real and imaginary parts in @var{szr}, @var{szi}.
@comment Exceptional Return Values: GSL_EOVRFLW
@end deftypefun

@deftypefun int gsl_sf_complex_cos_e (double @var{zr}, double @var{zi}, gsl_sf_result * @var{czr}, gsl_sf_result * @var{czi})
@cindex complex cosine function, special functions
This function computes the complex cosine, @math{\cos(z_r + i z_i)} storing
the real and imaginary parts in @var{szr}, @var{szi}.
@comment Exceptional Return Values: GSL_EOVRFLW
@end deftypefun

@deftypefun int gsl_sf_complex_logsin_e (double @var{zr}, double @var{zi}, gsl_sf_result * @var{lszr}, gsl_sf_result * @var{lszi})
@cindex complex log sine function, special functions
This function computes the logarithm of the complex sine,
@math{\log(\sin(z_r + i z_i))} storing the real and imaginary parts in
@var{szr}, @var{szi}.
@comment Exceptional Return Values: GSL_EDOM, GSL_ELOSS
@end deftypefun

@node Hyperbolic Trigonometric Functions
@subsection Hyperbolic Trigonometric Functions

@deftypefun double gsl_sf_lnsinh (double @var{x})
@deftypefunx int gsl_sf_lnsinh_e (double @var{x}, gsl_sf_result * @var{result})
@cindex logarithm of sinh function, special functions
These routines compute @math{\log(\sinh(x))} for @math{x > 0}.
@comment Domain: x > 0 
@comment Exceptional Return Values: GSL_EDOM
@end deftypefun

@deftypefun double gsl_sf_lncosh (double @var{x})
@deftypefunx int gsl_sf_lncosh_e (double @var{x}, gsl_sf_result * @var{result})
@cindex logarithm of cosh function, special functions
These routines compute @math{\log(\cosh(x))} for any @var{x}.
@comment Exceptional Return Values: none
@end deftypefun


@node Conversion Functions
@subsection Conversion Functions
@cindex polar to rectangular conversion
@cindex rectangular to polar conversion

@deftypefun int gsl_sf_polar_to_rect (double @var{r}, double @var{theta}, gsl_sf_result * @var{x}, gsl_sf_result * @var{y}); 
This function converts the polar coordinates (@var{r},@var{theta}) to
rectilinear coordinates (@var{x},@var{y}), @math{x = r\cos(\theta)},
@math{y = r\sin(\theta)}.
@comment Exceptional Return Values: GSL_ELOSS
@end deftypefun

@deftypefun int gsl_sf_rect_to_polar (double @var{x}, double @var{y}, gsl_sf_result * @var{r}, gsl_sf_result * @var{theta})
This function converts the rectilinear coordinates (@var{x},@var{y}) to
polar coordinates (@var{r},@var{theta}), such that @math{x =
r\cos(\theta)}, @math{y = r\sin(\theta)}.  The argument @var{theta}
lies in the range @math{[-\pi, \pi]}.
@comment Exceptional Return Values: GSL_EDOM
@end deftypefun

@node Restriction Functions
@subsection Restriction Functions
@cindex angular reduction
@cindex reduction of angular variables

@deftypefun double gsl_sf_angle_restrict_symm (double @var{theta})
@deftypefunx int gsl_sf_angle_restrict_symm_e (double * @var{theta})
These routines force the angle @var{theta} to lie in the range
@math{(-\pi,\pi]}.  

Note that the mathematical value of @math{\pi} is slightly greater
than @code{M_PI}, so the machine numbers @code{M_PI} and @code{-M_PI}
are included in the range.
@comment Exceptional Return Values: GSL_ELOSS
@end deftypefun

@deftypefun double gsl_sf_angle_restrict_pos (double @var{theta})
@deftypefunx int gsl_sf_angle_restrict_pos_e (double * @var{theta})
These routines force the angle @var{theta} to lie in the range @math{[0,
2\pi)}. 

Note that the mathematical value of @math{2\pi} is slightly greater
than @code{2*M_PI}, so the machine number @code{2*M_PI} is included in
the range.

@comment Exceptional Return Values: GSL_ELOSS
@end deftypefun


@node Trigonometric Functions With Error Estimates
@subsection Trigonometric Functions With Error Estimates

@deftypefun int gsl_sf_sin_err_e (double @var{x}, double @var{dx}, gsl_sf_result * @var{result})
This routine computes the sine of an angle @var{x} with an associated 
absolute error @var{dx},
@c{$\sin(x \pm dx)$}
@math{\sin(x \pm dx)}.  Note that this function is provided in the error-handling form only since
its purpose is to compute the propagated error.
@end deftypefun

@deftypefun int gsl_sf_cos_err_e (double @var{x}, double @var{dx}, gsl_sf_result * @var{result})
This routine computes the cosine of an angle @var{x} with an associated
absolute error @var{dx}, 
@c{$\cos(x \pm dx)$}
@math{\cos(x \pm dx)}.  Note that this function is provided in the error-handling form only since
its purpose is to compute the propagated error.
@end deftypefun