|
5 | 5 | */ |
6 | 6 |
|
7 | 7 | /** |
8 | | -* A collection of mathematical methods. |
| 8 | +* A collection of useful mathematical functions. |
| 9 | +* |
| 10 | +* These are normally accessed through `game.math`. |
9 | 11 | * |
10 | 12 | * @class Phaser.Math |
| 13 | +* @static |
| 14 | +* @see {@link Phaser.Utils} |
| 15 | +* @see {@link Phaser.ArrayUtils} |
11 | 16 | */ |
12 | 17 | Phaser.Math = { |
13 | 18 |
|
14 | 19 | /** |
15 | 20 | * Twice PI. |
16 | 21 | * @property {number} Phaser.Math#PI2 |
17 | 22 | * @default ~6.283 |
| 23 | + * @deprecated 2.1.4 - Not used internally. Use `2 * Math.PI` instead. |
18 | 24 | */ |
19 | 25 | PI2: Math.PI * 2, |
20 | 26 |
|
@@ -970,6 +976,8 @@ Phaser.Math = { |
970 | 976 | }, |
971 | 977 |
|
972 | 978 | /** |
| 979 | + * The (absolute) difference between two values. |
| 980 | + * |
973 | 981 | * @method Phaser.Math#difference |
974 | 982 | * @param {number} a |
975 | 983 | * @param {number} b |
@@ -1100,7 +1108,7 @@ Phaser.Math = { |
1100 | 1108 | * @method Phaser.Math#shift |
1101 | 1109 | * @param {array} stack - The array to shift. |
1102 | 1110 | * @return {any} The shifted value. |
1103 | | - * @deprecated 2.1.4 - Not used internally, better to do locally |
| 1111 | + * @deprecated 2.1.4 - Specialized function. Not used internally, better to do locally |
1104 | 1112 | */ |
1105 | 1113 | shift: function (stack) { |
1106 | 1114 |
|
@@ -1189,7 +1197,7 @@ Phaser.Math = { |
1189 | 1197 | }, |
1190 | 1198 |
|
1191 | 1199 | /** |
1192 | | - * Clamp value to range `[a, inf)`. |
| 1200 | + * Clamp `x` to the range `[a, Infinity)`. |
1193 | 1201 | * Roughly the same as `Math.max(x, a)`, except for NaN handling. |
1194 | 1202 | * |
1195 | 1203 | * @method Phaser.Math#clampBottom |
@@ -1261,7 +1269,7 @@ Phaser.Math = { |
1261 | 1269 | /** |
1262 | 1270 | * A value representing the sign of the value: -1 for negative, +1 for positive, 0 if value is 0. |
1263 | 1271 | * |
1264 | | - * This works differently from `Math.sign` for value of NaN and -0, etc. |
| 1272 | + * This works differently from `Math.sign` for values of NaN and -0, etc. |
1265 | 1273 | * |
1266 | 1274 | * @method Phaser.Math#sign |
1267 | 1275 | * @param {number} x |
|
0 commit comments