Documented Math.Distance, Math.Fuzzy and Math.Interpolation.

This commit is contained in:
Chris Andrew 2018-05-24 11:40:53 +01:00
parent d6d9b69897
commit 0f9bfc62f8
13 changed files with 64 additions and 64 deletions

View file

@ -5,17 +5,17 @@
*/
/**
* [description]
* Calculate the distance between two sets of coordinates (points).
*
* @function Phaser.Math.Distance.Between
* @since 3.0.0
*
* @param {number} x1 - [description]
* @param {number} y1 - [description]
* @param {number} x2 - [description]
* @param {number} y2 - [description]
* @param {number} x1 - The x coordinate of the first point.
* @param {number} y1 - The y coordinate of the first point.
* @param {number} x2 - The x coordinate of the second point.
* @param {number} y2 - The y coordinate of the second point.
*
* @return {number} [description]
* @return {number} The distance between each point.
*/
var DistanceBetween = function (x1, y1, x2, y2)
{

View file

@ -5,18 +5,18 @@
*/
/**
* [description]
* Calculate the distance between two sets of coordinates (points) to the power of `pow`.
*
* @function Phaser.Math.Distance.Power
* @since 3.0.0
*
* @param {number} x1 - [description]
* @param {number} y1 - [description]
* @param {number} x2 - [description]
* @param {number} y2 - [description]
* @param {number} pow - [description]
* @param {number} x1 - The x coordinate of the first point.
* @param {number} y1 - The y coordinate of the first point.
* @param {number} x2 - The x coordinate of the second point.
* @param {number} y2 - The y coordinate of the second point.
* @param {number} pow - The exponent.
*
* @return {number} [description]
* @return {number} The distance between each point.
*/
var DistancePower = function (x1, y1, x2, y2, pow)
{

View file

@ -5,17 +5,17 @@
*/
/**
* [description]
* Calculate the distance between two sets of coordinates (points), squared.
*
* @function Phaser.Math.Distance.Squared
* @since 3.0.0
*
* @param {number} x1 - [description]
* @param {number} y1 - [description]
* @param {number} x2 - [description]
* @param {number} y2 - [description]
* @param {number} x1 - The x coordinate of the first point.
* @param {number} y1 - The y coordinate of the first point.
* @param {number} x2 - The x coordinate of the second point.
* @param {number} y2 - The y coordinate of the second point.
*
* @return {number} [description]
* @return {number} The distance between each point, squared.
*/
var DistanceSquared = function (x1, y1, x2, y2)
{

View file

@ -5,15 +5,15 @@
*/
/**
* [description]
* Calculate the ceiling of the given value.
*
* @function Phaser.Math.Fuzzy.Ceil
* @since 3.0.0
*
* @param {number} value - [description]
* @param {float} [epsilon=0.0001] - [description]
* @param {number} value - The value.
* @param {float} [epsilon=0.0001] - The epsilon.
*
* @return {number} [description]
* @return {number} The ceiling of the value.
*/
var Ceil = function (value, epsilon)
{

View file

@ -5,16 +5,16 @@
*/
/**
* [description]
* Check whether the given values are equal.
*
* @function Phaser.Math.Fuzzy.Equal
* @since 3.0.0
*
* @param {number} a - [description]
* @param {number} b - [description]
* @param {float} [epsilon=0.0001] - [description]
* @param {number} a - The first value.
* @param {number} b - The second value.
* @param {float} [epsilon=0.0001] - The epsilon.
*
* @return {boolean} [description]
* @return {boolean} Whether the given values are equal.
*/
var Equal = function (a, b, epsilon)
{

View file

@ -5,15 +5,15 @@
*/
/**
* [description]
* Calculate the floor of the given value.
*
* @function Phaser.Math.Fuzzy.Floor
* @since 3.0.0
*
* @param {number} value - [description]
* @param {float} [epsilon=0.0001] - [description]
* @param {number} value - The value.
* @param {float} [epsilon=0.0001] - The epsilon.
*
* @return {number} [description]
* @return {number} The floor of the value.
*/
var Floor = function (value, epsilon)
{

View file

@ -5,16 +5,16 @@
*/
/**
* [description]
* Check whether `a` is greater than `b`.
*
* @function Phaser.Math.Fuzzy.GreaterThan
* @since 3.0.0
*
* @param {number} a - [description]
* @param {number} b - [description]
* @param {float} [epsilon=0.0001] - [description]
* @param {number} a - The first value.
* @param {number} b - The second value.
* @param {float} [epsilon=0.0001] - The epsilon.
*
* @return {boolean} [description]
* @return {boolean} Whether `a` is greater than `b`.
*/
var GreaterThan = function (a, b, epsilon)
{

View file

@ -5,16 +5,16 @@
*/
/**
* [description]
* Check whether `a` is less than `b`.
*
* @function Phaser.Math.Fuzzy.LessThan
* @since 3.0.0
*
* @param {number} a - [description]
* @param {number} b - [description]
* @param {float} [epsilon=0.0001] - [description]
* @param {number} a - The first value.
* @param {number} b - The second value.
* @param {float} [epsilon=0.0001] - The epsilon.
*
* @return {boolean} [description]
* @return {boolean} Whether `a` is less than `b`.
*/
var LessThan = function (a, b, epsilon)
{

View file

@ -7,15 +7,15 @@
var Bernstein = require('../Bernstein');
/**
* [description]
* A bezier interpolation method.
*
* @function Phaser.Math.Interpolation.Bezier
* @since 3.0.0
*
* @param {number} v - [description]
* @param {number} k - [description]
* @param {number[]} v - The input array of values to interpolate between.
* @param {number} k - The percentage of interpolation, between 0 and 1.
*
* @return {number} [description]
* @return {number} The interpolated value.
*/
var BezierInterpolation = function (v, k)
{

View file

@ -7,15 +7,15 @@
var CatmullRom = require('../CatmullRom');
/**
* [description]
* A Catmull-Rom interpolation method.
*
* @function Phaser.Math.Interpolation.CatmullRom
* @since 3.0.0
*
* @param {number} v - [description]
* @param {number} k - [description]
* @param {number[]} v - The input array of values to interpolate between.
* @param {number} k - The percentage of interpolation, between 0 and 1.
*
* @return {number} [description]
* @return {number} The interpolated value.
*/
var CatmullRomInterpolation = function (v, k)
{

View file

@ -36,18 +36,18 @@ function P3 (t, p)
// https://medium.com/@adrian_cooney/bezier-interpolation-13b68563313a
/**
* [description]
* A cubic bezier interpolation method.
*
* @function Phaser.Math.Interpolation.CubicBezier
* @since 3.0.0
*
* @param {float} t - [description]
* @param {number} p0 - [description]
* @param {number} p1 - [description]
* @param {number} p2 - [description]
* @param {number} p3 - [description]
* @param {float} t - The percentage of interpolation, between 0 and 1.
* @param {number} p0 - The start point.
* @param {number} p1 - The first control point.
* @param {number} p2 - The second control point.
* @param {number} p3 - The end point.
*
* @return {number} [description]
* @return {number} The interpolated value.
*/
var CubicBezierInterpolation = function (t, p0, p1, p2, p3)
{

View file

@ -7,7 +7,7 @@
var Linear = require('../Linear');
/**
* A Linear Interpolation Method.
* A linear interpolation method.
*
* @function Phaser.Math.Interpolation.Linear
* @since 3.0.0

View file

@ -28,17 +28,17 @@ function P2 (t, p)
// https://github.com/mrdoob/three.js/blob/master/src/extras/core/Interpolations.js
/**
* [description]
* A quadratic bezier interpolation method.
*
* @function Phaser.Math.Interpolation.QuadraticBezier
* @since 3.2.0
*
* @param {float} t - [description]
* @param {number} p0 - [description]
* @param {number} p1 - [description]
* @param {number} p2 - [description]
* @param {float} t - The percentage of interpolation, between 0 and 1.
* @param {number} p0 - The start point.
* @param {number} p1 - The control point.
* @param {number} p2 - The end point.
*
* @return {number} [description]
* @return {number} The interpolated value.
*/
var QuadraticBezierInterpolation = function (t, p0, p1, p2)
{