| _jn_jn-Lowcase DescriptionCompute the Bessel function. The _j0, _j1, and _jn routines return Bessel functions of the first kind: orders 0, 1, and n, respectively. Syntax
double _jn( int n, double x )
 Parameters
    n[input] Integer order of Bessel functionx[input] Floating-point value ReturnThe _jn returns a Bessel function of x. ExamplesEX1 
//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;
}
RemarkSee Also_j1 header to Includeorigin.h Reference |