Exemple #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)
}
Exemple #2
0
func J2(x float64) float64 {
	return float64(C.gsl_sf_bessel_j2(C.double(x)))
}