1 /* specfunc/gsl_sf_trig.h
3 * Copyright (C) 1996, 1997, 1998, 1999, 2000 Gerard Jungman
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or (at
8 * your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 /* Author: G. Jungman */
22 #ifndef __GSL_SF_TRIG_H__
23 #define __GSL_SF_TRIG_H__
25 #include <gsl/gsl_sf_result.h>
30 # define __BEGIN_DECLS extern "C" {
31 # define __END_DECLS }
33 # define __BEGIN_DECLS /* empty */
34 # define __END_DECLS /* empty */
40 /* Sin(x) with GSL semantics. This is actually important
41 * because we want to control the error estimate, and trying
42 * to guess the error for the standard library implementation
43 * every time it is used would be a little goofy.
45 int gsl_sf_sin_e(double x, gsl_sf_result * result);
46 double gsl_sf_sin(const double x);
49 /* Cos(x) with GSL semantics.
51 int gsl_sf_cos_e(double x, gsl_sf_result * result);
52 double gsl_sf_cos(const double x);
55 /* Hypot(x,y) with GSL semantics.
57 int gsl_sf_hypot_e(const double x, const double y, gsl_sf_result * result);
58 double gsl_sf_hypot(const double x, const double y);
61 /* Sin(z) for complex z
63 * exceptions: GSL_EOVRFLW
65 int gsl_sf_complex_sin_e(const double zr, const double zi, gsl_sf_result * szr, gsl_sf_result * szi);
68 /* Cos(z) for complex z
70 * exceptions: GSL_EOVRFLW
72 int gsl_sf_complex_cos_e(const double zr, const double zi, gsl_sf_result * czr, gsl_sf_result * czi);
75 /* Log(Sin(z)) for complex z
77 * exceptions: GSL_EDOM, GSL_ELOSS
79 int gsl_sf_complex_logsin_e(const double zr, const double zi, gsl_sf_result * lszr, gsl_sf_result * lszi);
82 /* Sinc(x) = sin(pi x) / (pi x)
86 int gsl_sf_sinc_e(double x, gsl_sf_result * result);
87 double gsl_sf_sinc(const double x);
90 /* Log(Sinh(x)), x > 0
92 * exceptions: GSL_EDOM
94 int gsl_sf_lnsinh_e(const double x, gsl_sf_result * result);
95 double gsl_sf_lnsinh(const double x);
102 int gsl_sf_lncosh_e(const double x, gsl_sf_result * result);
103 double gsl_sf_lncosh(const double x);
106 /* Convert polar to rectlinear coordinates.
108 * exceptions: GSL_ELOSS
110 int gsl_sf_polar_to_rect(const double r, const double theta, gsl_sf_result * x, gsl_sf_result * y);
112 /* Convert rectilinear to polar coordinates.
113 * return argument in range [-pi, pi]
115 * exceptions: GSL_EDOM
117 int gsl_sf_rect_to_polar(const double x, const double y, gsl_sf_result * r, gsl_sf_result * theta);
119 /* Sin(x) for quantity with an associated error.
121 int gsl_sf_sin_err_e(const double x, const double dx, gsl_sf_result * result);
124 /* Cos(x) for quantity with an associated error.
126 int gsl_sf_cos_err_e(const double x, const double dx, gsl_sf_result * result);
129 /* Force an angle to lie in the range (-pi,pi].
131 * exceptions: GSL_ELOSS
133 int gsl_sf_angle_restrict_symm_e(double * theta);
134 double gsl_sf_angle_restrict_symm(const double theta);
137 /* Force an angle to lie in the range [0, 2pi)
139 * exceptions: GSL_ELOSS
141 int gsl_sf_angle_restrict_pos_e(double * theta);
142 double gsl_sf_angle_restrict_pos(const double theta);
145 int gsl_sf_angle_restrict_symm_err_e(const double theta, gsl_sf_result * result);
147 int gsl_sf_angle_restrict_pos_err_e(const double theta, gsl_sf_result * result);
152 #endif /* __GSL_SF_TRIG_H__ */