Пример #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)
}
Пример #2
0
func J1(x float64) float64 {
	return float64(C.gsl_sf_bessel_J1(C.double(x)))
}