Compute the Bessel function. The _j0, _j1, and _jn routines return Bessel functions of the first kind: orders 0, 1, and n, respectively.
double _jn( int n, double x )
The _jn returns a Bessel function of x.
EX1
//This program illustrates Bessel functions. #include <origin.h> int test_Jn() { double vv; vv = _jn( 1,1 ); out_double("_jn(1,1)=", vv); //output should be _jn(1,1)=0.44005 ASSERT( is_equal( round(vv, 5), 0.44005) ); vv = _jn( 0,0 ); out_double("_jn(0,0)=", vv); //output should be _jn(0,0)=1 ASSERT( is_equal(vv, 1) ); vv = _jn(2,3.5); out_double("_jn(2,3.5)=", vv); //output should be _jn(2,3.5)=0.45863 ASSERT( is_equal(round(vv,5), 0.45863) ); return 1; }
origin.h