mirror of
https://github.com/photonstorm/phaser
synced 2024-12-23 19:43:28 +00:00
25 lines
561 B
JavaScript
25 lines
561 B
JavaScript
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2018 Photon Storm Ltd.
|
|
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
|
*/
|
|
|
|
var Factorial = require('./Factorial');
|
|
|
|
/**
|
|
* [description]
|
|
*
|
|
* @function Phaser.Math.Bernstein
|
|
* @since 3.0.0
|
|
*
|
|
* @param {number} n - [description]
|
|
* @param {number} i - [description]
|
|
*
|
|
* @return {number} [description]
|
|
*/
|
|
var Bernstein = function (n, i)
|
|
{
|
|
return Factorial(n) / Factorial(i) / Factorial(n - i);
|
|
};
|
|
|
|
module.exports = Bernstein;
|