Namespace: Interpolation

Phaser.Math. Interpolation

Methods


<static> Bezier(v, k)

A bezier interpolation method.

Parameters:
Name Type Description
v Array.<number>

The input array of values to interpolate between.

k number

The percentage of interpolation, between 0 and 1.

Since: 3.0.0
Source: src/math/interpolation/BezierInterpolation.js (Line 9)
Returns:

The interpolated value.

Type
number

<static> CatmullRom(v, k)

A Catmull-Rom interpolation method.

Parameters:
Name Type Description
v Array.<number>

The input array of values to interpolate between.

k number

The percentage of interpolation, between 0 and 1.

Since: 3.0.0
Source: src/math/interpolation/CatmullRomInterpolation.js (Line 9)
Returns:

The interpolated value.

Type
number

<static> CubicBezier(t, p0, p1, p2, p3)

A cubic bezier interpolation method.

https://medium.com/@adrian_cooney/bezier-interpolation-13b68563313a

Parameters:
Name Type Description
t number

The percentage of interpolation, between 0 and 1.

p0 number

The start point.

p1 number

The first control point.

p2 number

The second control point.

p3 number

The end point.

Since: 3.0.0
Source: src/math/interpolation/CubicBezierInterpolation.js (Line 43)
Returns:

The interpolated value.

Type
number

<static> Linear(v, k)

A linear interpolation method.

Parameters:
Name Type Description
v Array.<number>

The input array of values to interpolate between.

k number

The percentage of interpolation, between 0 and 1.

Since: 3.0.0
Source: src/math/interpolation/LinearInterpolation.js (Line 9)
See:
Returns:

The interpolated value.

Type
number

<static> QuadraticBezier(t, p0, p1, p2)

A quadratic bezier interpolation method.

Parameters:
Name Type Description
t number

The percentage of interpolation, between 0 and 1.

p0 number

The start point.

p1 number

The control point.

p2 number

The end point.

Since: 3.2.0
Source: src/math/interpolation/QuadraticBezierInterpolation.js (Line 35)
Returns:

The interpolated value.

Type
number

<static> SmootherStep(t, min, max)

A Smoother Step interpolation method.

Parameters:
Name Type Description
t number

The percentage of interpolation, between 0 and 1.

min number

The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.

max number

The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.

Since: 3.9.0
Source: src/math/interpolation/SmootherStepInterpolation.js (Line 9)
See:
Returns:

The interpolated value.

Type
number

<static> SmoothStep(t, min, max)

A Smooth Step interpolation method.

Parameters:
Name Type Description
t number

The percentage of interpolation, between 0 and 1.

min number

The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.

max number

The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.

Since: 3.9.0
Source: src/math/interpolation/SmoothStepInterpolation.js (Line 9)
See:
Returns:

The interpolated value.

Type
number