# Bessel 函數：_j0、_j1、_jn、_y0、_y1、_yn

Visual Studio 2015

## 語法

```double _j0(
double x
);
double _j1(
double x
);
double _jn(
int n,
double x
);
double _y0(
double x
);
double _y1(
double x
);
double _yn(
int n,
double x
);

```

`x`

`n`
Bessel 函數的整數階數。

## 備註

`_j0``_j1``_jn` 常式會分別傳回 0、1 和 n 階的第一類 Bessel 函數。

± `QNAN`,`IND``INVALID``_DOMAIN`

`_y0``_y1``_yn` 常式會分別傳回 0、1 和 n 階的第二類 Bessel 函數。

± `QNAN`,`IND``INVALID``_DOMAIN`
± 0`ZERODIVIDE``_SING`
x<0.0></0.0>`INVALID``_DOMAIN`

## 需求

`_j0`, `_j1`, `_jn`, `_y0`, `_y1`, `_yn`<>>(C++), <math.h> (C, C++)</math.h>

## 範例

```// crt_bessel1.c
#include <math.h>
#include <stdio.h>

int main( void )
{
double x = 2.387;
int n = 3, c;

printf( "Bessel functions for x = %f:\n", x );
printf( " Kind   Order  Function     Result\n\n" );
printf( " First  0      _j0( x )     %f\n", _j0( x ) );
printf( " First  1      _j1( x )     %f\n", _j1( x ) );
for( c = 2; c < 5; c++ )
printf( " First  %d      _jn( %d, x )  %f\n", c, c, _jn( c, x ) );
printf( " Second 0      _y0( x )     %f\n", _y0( x ) );
printf( " Second 1      _y1( x )     %f\n", _y1( x ) );
for( c = 2; c < 5; c++ )
printf( " Second %d      _yn( %d, x )  %f\n", c, c, _yn( c, x ) );
}

```
```Bessel functions for x = 2.387000:
Kind   Order  Function     Result

First  0      _j0( x )     0.009288
First  1      _j1( x )     0.522941
First  2      _jn( 2, x )  0.428870
First  3      _jn( 3, x )  0.195734
First  4      _jn( 4, x )  0.063131
Second 0      _y0( x )     0.511681
Second 1      _y1( x )     0.094374
Second 2      _yn( 2, x )  -0.432608
Second 3      _yn( 3, x )  -0.819314
Second 4      _yn( 4, x )  -1.626833

```