_j1

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 _j1( double x )

Parameters

x
[input] Floating-point value

Return

The _j1 returns a Bessel function of x.

Examples

EX1

//This program illustrates Bessel functions.

#include <origin.h>

int test_J1()
{
    double vv;
    
    vv = _j1( 0 );            
    out_double( "_j1(0)=", vv );            //output should be _j1(0)=0
    ASSERT( is_equal(vv, 0) );
    
    vv = _j1(1.3);            
    out_double( "_j1(1.3)=", vv );            //output should be _j1(1.3)=0.52202
    ASSERT( is_equal(round(vv,5), 0.52202) );
    
    out_double( "_j1(2)=", _j1(2) );        //output should be _j1(2)=0.57672
    
    out_double( "_j1(-2)=", _j1(-2) );        //output should be _j1(-2)=-0.57672    
    ASSERT( is_equal(_j1(-2), -_j1(2)) );
    
    return 1;
}

Remark

See Also

header to Include

origin.h

Reference