|
||
---|---|---|
.. | ||
docs | ||
lib | ||
package.json | ||
README.md |
sinc
Compute the cardinal sine of a number.
The normalized cardinal sine function is defined as
for any real number x
.
Usage
var sinc = require( '@stdlib/math/base/special/sinc' );
sinc( x )
Computes the normalized cardinal sine of a number
.
var v = sinc( 0.5 );
// returns ~0.637
v = sinc( -1.2 );
// returns ~-0.156
v = sinc( 0.0 );
// returns 1.0
v = sinc( NaN );
// returns NaN
Examples
var linspace = require( '@stdlib/array/linspace' );
var sinc = require( '@stdlib/math/base/special/sinc' );
var x = linspace( -5.0, 5.0, 100 );
var i;
for ( i = 0; i < x.length; i++ ) {
console.log( sinc( x[ i ] ) );
}