/
trig.go
executable file
·97 lines (73 loc) · 3.53 KB
/
trig.go
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
////////// AUTOMATICALLY GENERATED CODE - DO NOT EDIT //////////
package trig
/*
#cgo pkg-config: --define-variable=prefix=. gsl
#include <gsl/gsl_sf_result.h>
#include <gsl/gsl_sf_trig.h>
*/
import "C"
import "github.com/dtromb/gogsl/sf"
import "unsafe"
func Sin(x float64) float64 {
return float64(C.gsl_sf_sin(C.double(x)))
}
func SinE(x float64, result *sf.GslSfResult) int32 {
return int32(C.gsl_sf_sin_e(C.double(x), (*C.gsl_sf_result)(unsafe.Pointer(result.Ptr()))))
}
func Cos(x float64) float64 {
return float64(C.gsl_sf_cos(C.double(x)))
}
func CosE(x float64, result *sf.GslSfResult) int32 {
return int32(C.gsl_sf_cos_e(C.double(x), (*C.gsl_sf_result)(unsafe.Pointer(result.Ptr()))))
}
func Hypot(x float64, y float64) float64 {
return float64(C.gsl_sf_hypot(C.double(x), C.double(y)))
}
func HypotE(x float64, y float64, result *sf.GslSfResult) int32 {
return int32(C.gsl_sf_hypot_e(C.double(x), C.double(y), (*C.gsl_sf_result)(unsafe.Pointer(result.Ptr()))))
}
func Sinc(x float64) float64 {
return float64(C.gsl_sf_sinc(C.double(x)))
}
func SincE(x float64, result *sf.GslSfResult) int32 {
return int32(C.gsl_sf_sinc_e(C.double(x), (*C.gsl_sf_result)(unsafe.Pointer(result.Ptr()))))
}
func ComplexSinE(zr float64, zi float64, szr *sf.GslSfResult, szi *sf.GslSfResult) int32 {
return int32(C.gsl_sf_complex_sin_e(C.double(zr), C.double(zi), (*C.gsl_sf_result)(unsafe.Pointer(szr.Ptr())), (*C.gsl_sf_result)(unsafe.Pointer(szi.Ptr()))))
}
func ComplexCosE(zr float64, zi float64, czr *sf.GslSfResult, czi *sf.GslSfResult) int32 {
return int32(C.gsl_sf_complex_cos_e(C.double(zr), C.double(zi), (*C.gsl_sf_result)(unsafe.Pointer(czr.Ptr())), (*C.gsl_sf_result)(unsafe.Pointer(czi.Ptr()))))
}
func ComplexLogsinE(zr float64, zi float64, lszr *sf.GslSfResult, lszi *sf.GslSfResult) int32 {
return int32(C.gsl_sf_complex_logsin_e(C.double(zr), C.double(zi), (*C.gsl_sf_result)(unsafe.Pointer(lszr.Ptr())), (*C.gsl_sf_result)(unsafe.Pointer(lszi.Ptr()))))
}
func Lnsinh(x float64) float64 {
return float64(C.gsl_sf_lnsinh(C.double(x)))
}
func LnsinhE(x float64, result *sf.GslSfResult) int32 {
return int32(C.gsl_sf_lnsinh_e(C.double(x), (*C.gsl_sf_result)(unsafe.Pointer(result.Ptr()))))
}
func Lncosh(x float64) float64 {
return float64(C.gsl_sf_lncosh(C.double(x)))
}
func LncoshE(x float64, result *sf.GslSfResult) int32 {
return int32(C.gsl_sf_lncosh_e(C.double(x), (*C.gsl_sf_result)(unsafe.Pointer(result.Ptr()))))
}
func PolarToRect(r float64, theta float64, x *sf.GslSfResult, y *sf.GslSfResult) int32 {
return int32(C.gsl_sf_polar_to_rect(C.double(r), C.double(theta), (*C.gsl_sf_result)(unsafe.Pointer(x.Ptr())), (*C.gsl_sf_result)(unsafe.Pointer(y.Ptr()))))
}
func RectToPolar(x float64, y float64, r *sf.GslSfResult, theta *sf.GslSfResult) int32 {
return int32(C.gsl_sf_rect_to_polar(C.double(x), C.double(y), (*C.gsl_sf_result)(unsafe.Pointer(r.Ptr())), (*C.gsl_sf_result)(unsafe.Pointer(theta.Ptr()))))
}
func AngleRestrictSymm(theta float64) float64 {
return float64(C.gsl_sf_angle_restrict_symm(C.double(theta)))
}
func AngleRestrictPos(theta float64) float64 {
return float64(C.gsl_sf_angle_restrict_pos(C.double(theta)))
}
func SinErrE(x float64, dx float64, result *sf.GslSfResult) int32 {
return int32(C.gsl_sf_sin_err_e(C.double(x), C.double(dx), (*C.gsl_sf_result)(unsafe.Pointer(result.Ptr()))))
}
func CosErrE(x float64, dx float64, result *sf.GslSfResult) int32 {
return int32(C.gsl_sf_cos_err_e(C.double(x), C.double(dx), (*C.gsl_sf_result)(unsafe.Pointer(result.Ptr()))))
}