summaryrefslogtreecommitdiff
path: root/lib/Numeric/GSL/Special/Trig.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Numeric/GSL/Special/Trig.hs')
-rw-r--r--lib/Numeric/GSL/Special/Trig.hs164
1 files changed, 164 insertions, 0 deletions
diff --git a/lib/Numeric/GSL/Special/Trig.hs b/lib/Numeric/GSL/Special/Trig.hs
new file mode 100644
index 0000000..b846c1d
--- /dev/null
+++ b/lib/Numeric/GSL/Special/Trig.hs
@@ -0,0 +1,164 @@
1------------------------------------------------------------
2{- |
3Module : Numeric.GSL.Special.Trig
4Copyright : (c) Alberto Ruiz 2006
5License : GPL-style
6Maintainer : Alberto Ruiz (aruiz at um dot es)
7Stability : provisional
8Portability : uses ffi
9
10Wrappers for selected functions described at:
11
12<http://www.gnu.org/software/gsl/manual/html_node/Trigonometric-Functions.html>
13
14-}
15------------------------------------------------------------
16
17module Numeric.GSL.Special.Trig(
18 sin_e
19, Numeric.GSL.Special.Trig.sin
20, cos_e
21, Numeric.GSL.Special.Trig.cos
22, hypot_e
23, hypot
24, sinc_e
25, sinc
26, lnsinh_e
27, lnsinh
28, lncosh_e
29, lncosh
30, sin_err_e
31, cos_err_e
32, angle_restrict_symm
33, angle_restrict_pos
34, angle_restrict_symm_err_e
35, angle_restrict_pos_err_e
36) where
37
38import Foreign(Ptr)
39import Numeric.GSL.Special.Internal
40
41-- | wrapper for int gsl_sf_sin_e(double x,gsl_sf_result* result);
42sin_e :: Double -> (Double,Double)
43sin_e x = createSFR "sin_e" $ gsl_sf_sin_e x
44foreign import ccall "trig.h gsl_sf_sin_e" gsl_sf_sin_e :: Double -> Ptr Double -> IO(Int)
45
46-- | wrapper for double gsl_sf_sin(double x);
47sin :: Double -> Double
48sin = gsl_sf_sin
49foreign import ccall "trig.h gsl_sf_sin" gsl_sf_sin :: Double -> Double
50
51-- | wrapper for int gsl_sf_cos_e(double x,gsl_sf_result* result);
52cos_e :: Double -> (Double,Double)
53cos_e x = createSFR "cos_e" $ gsl_sf_cos_e x
54foreign import ccall "trig.h gsl_sf_cos_e" gsl_sf_cos_e :: Double -> Ptr Double -> IO(Int)
55
56-- | wrapper for double gsl_sf_cos(double x);
57cos :: Double -> Double
58cos = gsl_sf_cos
59foreign import ccall "trig.h gsl_sf_cos" gsl_sf_cos :: Double -> Double
60
61-- | wrapper for int gsl_sf_hypot_e(double x,double y,gsl_sf_result* result);
62hypot_e :: Double -> Double -> (Double,Double)
63hypot_e x y = createSFR "hypot_e" $ gsl_sf_hypot_e x y
64foreign import ccall "trig.h gsl_sf_hypot_e" gsl_sf_hypot_e :: Double -> Double -> Ptr Double -> IO(Int)
65
66-- | wrapper for double gsl_sf_hypot(double x,double y);
67hypot :: Double -> Double -> Double
68hypot = gsl_sf_hypot
69foreign import ccall "trig.h gsl_sf_hypot" gsl_sf_hypot :: Double -> Double -> Double
70
71-- | wrapper for int gsl_sf_complex_sin_e(double zr,double zi,gsl_sf_result* szr,gsl_sf_result* szi);
72complex_sin_e :: Double -> Double -> Ptr Double -> (Double,Double)
73complex_sin_e zr zi szr = createSFR "complex_sin_e" $ gsl_sf_complex_sin_e zr zi szr
74foreign import ccall "trig.h gsl_sf_complex_sin_e" gsl_sf_complex_sin_e :: Double -> Double -> Ptr Double -> Ptr Double -> IO(Int)
75
76-- | wrapper for int gsl_sf_complex_cos_e(double zr,double zi,gsl_sf_result* czr,gsl_sf_result* czi);
77complex_cos_e :: Double -> Double -> Ptr Double -> (Double,Double)
78complex_cos_e zr zi czr = createSFR "complex_cos_e" $ gsl_sf_complex_cos_e zr zi czr
79foreign import ccall "trig.h gsl_sf_complex_cos_e" gsl_sf_complex_cos_e :: Double -> Double -> Ptr Double -> Ptr Double -> IO(Int)
80
81-- | wrapper for int gsl_sf_complex_logsin_e(double zr,double zi,gsl_sf_result* lszr,gsl_sf_result* lszi);
82complex_logsin_e :: Double -> Double -> Ptr Double -> (Double,Double)
83complex_logsin_e zr zi lszr = createSFR "complex_logsin_e" $ gsl_sf_complex_logsin_e zr zi lszr
84foreign import ccall "trig.h gsl_sf_complex_logsin_e" gsl_sf_complex_logsin_e :: Double -> Double -> Ptr Double -> Ptr Double -> IO(Int)
85
86-- | wrapper for int gsl_sf_sinc_e(double x,gsl_sf_result* result);
87sinc_e :: Double -> (Double,Double)
88sinc_e x = createSFR "sinc_e" $ gsl_sf_sinc_e x
89foreign import ccall "trig.h gsl_sf_sinc_e" gsl_sf_sinc_e :: Double -> Ptr Double -> IO(Int)
90
91-- | wrapper for double gsl_sf_sinc(double x);
92sinc :: Double -> Double
93sinc = gsl_sf_sinc
94foreign import ccall "trig.h gsl_sf_sinc" gsl_sf_sinc :: Double -> Double
95
96-- | wrapper for int gsl_sf_lnsinh_e(double x,gsl_sf_result* result);
97lnsinh_e :: Double -> (Double,Double)
98lnsinh_e x = createSFR "lnsinh_e" $ gsl_sf_lnsinh_e x
99foreign import ccall "trig.h gsl_sf_lnsinh_e" gsl_sf_lnsinh_e :: Double -> Ptr Double -> IO(Int)
100
101-- | wrapper for double gsl_sf_lnsinh(double x);
102lnsinh :: Double -> Double
103lnsinh = gsl_sf_lnsinh
104foreign import ccall "trig.h gsl_sf_lnsinh" gsl_sf_lnsinh :: Double -> Double
105
106-- | wrapper for int gsl_sf_lncosh_e(double x,gsl_sf_result* result);
107lncosh_e :: Double -> (Double,Double)
108lncosh_e x = createSFR "lncosh_e" $ gsl_sf_lncosh_e x
109foreign import ccall "trig.h gsl_sf_lncosh_e" gsl_sf_lncosh_e :: Double -> Ptr Double -> IO(Int)
110
111-- | wrapper for double gsl_sf_lncosh(double x);
112lncosh :: Double -> Double
113lncosh = gsl_sf_lncosh
114foreign import ccall "trig.h gsl_sf_lncosh" gsl_sf_lncosh :: Double -> Double
115
116-- | wrapper for int gsl_sf_polar_to_rect(double r,double theta,gsl_sf_result* x,gsl_sf_result* y);
117polar_to_rect :: Double -> Double -> Ptr Double -> (Double,Double)
118polar_to_rect r theta x = createSFR "polar_to_rect" $ gsl_sf_polar_to_rect r theta x
119foreign import ccall "trig.h gsl_sf_polar_to_rect" gsl_sf_polar_to_rect :: Double -> Double -> Ptr Double -> Ptr Double -> IO(Int)
120
121-- | wrapper for int gsl_sf_rect_to_polar(double x,double y,gsl_sf_result* r,gsl_sf_result* theta);
122rect_to_polar :: Double -> Double -> Ptr Double -> (Double,Double)
123rect_to_polar x y r = createSFR "rect_to_polar" $ gsl_sf_rect_to_polar x y r
124foreign import ccall "trig.h gsl_sf_rect_to_polar" gsl_sf_rect_to_polar :: Double -> Double -> Ptr Double -> Ptr Double -> IO(Int)
125
126-- | wrapper for int gsl_sf_sin_err_e(double x,double dx,gsl_sf_result* result);
127sin_err_e :: Double -> Double -> (Double,Double)
128sin_err_e x dx = createSFR "sin_err_e" $ gsl_sf_sin_err_e x dx
129foreign import ccall "trig.h gsl_sf_sin_err_e" gsl_sf_sin_err_e :: Double -> Double -> Ptr Double -> IO(Int)
130
131-- | wrapper for int gsl_sf_cos_err_e(double x,double dx,gsl_sf_result* result);
132cos_err_e :: Double -> Double -> (Double,Double)
133cos_err_e x dx = createSFR "cos_err_e" $ gsl_sf_cos_err_e x dx
134foreign import ccall "trig.h gsl_sf_cos_err_e" gsl_sf_cos_err_e :: Double -> Double -> Ptr Double -> IO(Int)
135
136-- | wrapper for int gsl_sf_angle_restrict_symm_e(double* theta);
137angle_restrict_symm_e :: Ptr Double -> Int
138angle_restrict_symm_e = gsl_sf_angle_restrict_symm_e
139foreign import ccall "trig.h gsl_sf_angle_restrict_symm_e" gsl_sf_angle_restrict_symm_e :: Ptr Double -> Int
140
141-- | wrapper for double gsl_sf_angle_restrict_symm(double theta);
142angle_restrict_symm :: Double -> Double
143angle_restrict_symm = gsl_sf_angle_restrict_symm
144foreign import ccall "trig.h gsl_sf_angle_restrict_symm" gsl_sf_angle_restrict_symm :: Double -> Double
145
146-- | wrapper for int gsl_sf_angle_restrict_pos_e(double* theta);
147angle_restrict_pos_e :: Ptr Double -> Int
148angle_restrict_pos_e = gsl_sf_angle_restrict_pos_e
149foreign import ccall "trig.h gsl_sf_angle_restrict_pos_e" gsl_sf_angle_restrict_pos_e :: Ptr Double -> Int
150
151-- | wrapper for double gsl_sf_angle_restrict_pos(double theta);
152angle_restrict_pos :: Double -> Double
153angle_restrict_pos = gsl_sf_angle_restrict_pos
154foreign import ccall "trig.h gsl_sf_angle_restrict_pos" gsl_sf_angle_restrict_pos :: Double -> Double
155
156-- | wrapper for int gsl_sf_angle_restrict_symm_err_e(double theta,gsl_sf_result* result);
157angle_restrict_symm_err_e :: Double -> (Double,Double)
158angle_restrict_symm_err_e theta = createSFR "angle_restrict_symm_err_e" $ gsl_sf_angle_restrict_symm_err_e theta
159foreign import ccall "trig.h gsl_sf_angle_restrict_symm_err_e" gsl_sf_angle_restrict_symm_err_e :: Double -> Ptr Double -> IO(Int)
160
161-- | wrapper for int gsl_sf_angle_restrict_pos_err_e(double theta,gsl_sf_result* result);
162angle_restrict_pos_err_e :: Double -> (Double,Double)
163angle_restrict_pos_err_e theta = createSFR "angle_restrict_pos_err_e" $ gsl_sf_angle_restrict_pos_err_e theta
164foreign import ccall "trig.h gsl_sf_angle_restrict_pos_err_e" gsl_sf_angle_restrict_pos_err_e :: Double -> Ptr Double -> IO(Int)