示例#1
0
文件: bessel.go 项目: npadmana/npgo
// 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
文件: bessel.go 项目: kofron/gogsl
func BesselJn(order int, x float64) (result float64) {
	result = (float64)(C.gsl_sf_bessel_Jn((C.int)(order), (C.double)(x)))
	return
}
示例#3
0
func Jn(n int32, x float64) float64 {
	return float64(C.gsl_sf_bessel_Jn(C.int(n), C.double(x)))
}