File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -829,7 +829,7 @@ Phaser.Math = {
829829 /**
830830 * A Linear Interpolation Method, mostly used by Phaser.Tween.
831831 * @method Phaser.Math#linearInterpolation
832- * @param {number } v
832+ * @param {Array } v
833833 * @param {number } k
834834 * @return {number }
835835 */
@@ -856,7 +856,7 @@ Phaser.Math = {
856856 /**
857857 * A Bezier Interpolation Method, mostly used by Phaser.Tween.
858858 * @method Phaser.Math#bezierInterpolation
859- * @param {number } v
859+ * @param {Array } v
860860 * @param {number } k
861861 * @return {number }
862862 */
@@ -877,7 +877,7 @@ Phaser.Math = {
877877 /**
878878 * A Catmull Rom Interpolation Method, mostly used by Phaser.Tween.
879879 * @method Phaser.Math#catmullRomInterpolation
880- * @param {number } v
880+ * @param {Array } v
881881 * @param {number } k
882882 * @return {number }
883883 */
@@ -936,6 +936,28 @@ Phaser.Math = {
936936 return this . factorial ( n ) / this . factorial ( i ) / this . factorial ( n - i ) ;
937937 } ,
938938
939+ /**
940+ * @method Phaser.Math#factorial
941+ * @param {number } value - the number you want to evaluate
942+ * @return {number }
943+ */
944+ factorial : function ( value ) {
945+
946+ if ( value === 0 )
947+ {
948+ return 1 ;
949+ }
950+
951+ var res = value ;
952+
953+ while ( -- value )
954+ {
955+ res *= value ;
956+ }
957+
958+ return res ;
959+ } ,
960+
939961 /**
940962 * Description.
941963 * @method Phaser.Math#catmullRom
@@ -1364,4 +1386,4 @@ Phaser.Math = {
13641386
13651387 } ( ) )
13661388
1367- } ;
1389+ } ;
You can’t perform that action at this time.
0 commit comments