arcade-physics
Version:
Use Arcade Physics without Phaser.
27 lines • 967 B
JavaScript
;
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const Factorial_1 = __importDefault(require("./Factorial"));
/**
* Calculates the Bernstein basis from the three factorial coefficients.
*
* @function Phaser.Math.Bernstein
* @since 3.0.0
*
* @param {number} n - The first value.
* @param {number} i - The second value.
*
* @return {number} The Bernstein basis of Factorial(n) / Factorial(i) / Factorial(n - i)
*/
const Bernstein = (n, i) => {
return (0, Factorial_1.default)(n) / (0, Factorial_1.default)(i) / (0, Factorial_1.default)(n - i);
};
exports.default = Bernstein;
//# sourceMappingURL=Bernstein.js.map