_jn

Description

Compute 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 function
x
[input] Floating-point value

Return

The _jn returns a Bessel function of x.

Examples

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;
}

Remark

See Also

_j1

header to Include

origin.h

Reference