README.md (2486B)
1 <!-- 2 3 @license Apache-2.0 4 5 Copyright (c) 2018 The Stdlib Authors. 6 7 Licensed under the Apache License, Version 2.0 (the "License"); 8 you may not use this file except in compliance with the License. 9 You may obtain a copy of the License at 10 11 http://www.apache.org/licenses/LICENSE-2.0 12 13 Unless required by applicable law or agreed to in writing, software 14 distributed under the License is distributed on an "AS IS" BASIS, 15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 See the License for the specific language governing permissions and 17 limitations under the License. 18 19 --> 20 21 # j0 22 23 > Compute the [Bessel function of the first kind][bessel-first-kind] of order zero. 24 25 <section class="intro"> 26 27 The [Bessel function of the first kind][bessel-first-kind] of order zero is defined as 28 29 <!-- <equation class="equation" label="eq:bessel_first_kind_order_zero" align="center" raw="J_0 (x) = \frac{1}{2 \pi} \int_{-\pi}^\pi e^{- i x \sin(\tau)} \,d\tau." alt="Bessel function of the first kind of order zero"> --> 30 31 <div class="equation" align="center" data-raw-text="J_0 (x) = \frac{1}{2 \pi} \int_{-\pi}^\pi e^{- i x \sin(\tau)} \,d\tau." data-equation="eq:bessel_first_kind_order_zero"> 32 <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@bb29798906e119fcb2af99e94b60407a270c9b32/lib/node_modules/@stdlib/math/base/special/besselj0/docs/img/equation_bessel_first_kind_order_zero.svg" alt="Bessel function of the first kind of order zero"> 33 <br> 34 </div> 35 36 <!-- </equation> --> 37 38 </section> 39 40 <!-- /.intro --> 41 42 <section class="usage"> 43 44 ## Usage 45 46 ```javascript 47 var j0 = require( '@stdlib/math/base/special/besselj0' ); 48 ``` 49 50 #### j0( x ) 51 52 Compute the [Bessel function of the first kind][bessel-first-kind] of order zero at `x`. 53 54 ```javascript 55 var v = j0( 0.0 ); 56 // returns 1.0 57 58 v = j0( 1.0 ); 59 // returns ~0.765 60 61 v = j0( Infinity ); 62 // returns 0.0 63 64 v = j0( -Infinity ); 65 // returns 0.0 66 67 v = j0( NaN ); 68 // returns NaN 69 ``` 70 71 </section> 72 73 <!-- /.usage --> 74 75 <section class="examples"> 76 77 ## Examples 78 79 <!-- eslint no-undef: "error" --> 80 81 ```javascript 82 var randu = require( '@stdlib/random/base/randu' ); 83 var j0 = require( '@stdlib/math/base/special/besselj0' ); 84 85 var x; 86 var i; 87 88 for ( i = 0; i < 100; i++ ) { 89 x = randu() * 10.0; 90 console.log( 'j0(%d) = %d', x, j0( x ) ); 91 } 92 ``` 93 94 </section> 95 96 <!-- /.examples --> 97 98 <section class="links"> 99 100 [bessel-first-kind]: https://en.wikipedia.org/wiki/Bessel_function#Bessel_functions_of_the_first_kind:_J.CE.B1 101 102 </section> 103 104 <!-- /.links -->