Beispiel #1
0
// BesselJ returns Jn(x)
func BesselJ(n int, x float64) float64 {
	var y C.double
	switch n {
	case 0:
		y = C.gsl_sf_bessel_J0(C.double(x))
	case 1:
		y = C.gsl_sf_bessel_J1(C.double(x))
	default:
		y = C.gsl_sf_bessel_Jn(C.int(n), C.double(x))
	}
	return float64(y)
}
Beispiel #2
0
func BesselJn(order int, x float64) (result float64) {
	result = (float64)(C.gsl_sf_bessel_Jn((C.int)(order), (C.double)(x)))
	return
}
Beispiel #3
0
func Jn(n int32, x float64) float64 {
	return float64(C.gsl_sf_bessel_Jn(C.int(n), C.double(x)))
}