sinc

Compute the cardinal sine of a number.

The normalized cardinal sine function is defined as

s i n c left-parenthesis x right-parenthesis colon equals StartLayout Enlarged left-brace 1st Row 1st Column StartFraction sine left-parenthesis pi x right-parenthesis Over pi x EndFraction 2nd Column if x not-equals 0 2nd Row 1st Column 1 2nd Column if x equals 0 EndLayout

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/base/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 ] ) );
}
Did you find this page helpful?