Beispiel #1
0
// SphBessel returns the spherical bessel function jl(x)
func SphBessel(l int, x float64) float64 {
	var y C.double
	switch l {
	case 0:
		y = C.gsl_sf_bessel_j0(C.double(x))
	case 1:
		y = C.gsl_sf_bessel_j1(C.double(x))
	case 2:
		y = C.gsl_sf_bessel_j2(C.double(x))
	default:
		y = C.gsl_sf_bessel_jl(C.int(l), C.double(x))
	}
	return float64(y)
}
Beispiel #2
0
func Jl(l int32, x float64) float64 {
	return float64(C.gsl_sf_bessel_jl(C.int(l), C.double(x)))
}