Skip to main content
Version: Phaser v3.88.2

Phaser.Math.Interpolation

Scope: static

Source: src/math/interpolation/index.js#L7

Static functions

Bezier

<static> Bezier(v, k)

Description:

A bezier interpolation method.

Parameters:

nametypeoptionaldescription
vArray.<number>NoThe input array of values to interpolate between.
knumberNoThe percentage of interpolation, between 0 and 1.

Returns: number - The interpolated value.

Source: src/math/interpolation/BezierInterpolation.js#L9
Since: 3.0.0


CatmullRom

<static> CatmullRom(v, k)

Description:

A Catmull-Rom interpolation method.

Parameters:

nametypeoptionaldescription
vArray.<number>NoThe input array of values to interpolate between.
knumberNoThe percentage of interpolation, between 0 and 1.

Returns: number - The interpolated value.

Source: src/math/interpolation/CatmullRomInterpolation.js#L9
Since: 3.0.0


CubicBezier

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

Description:

A cubic bezier interpolation method.

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

Parameters:

nametypeoptionaldescription
tnumberNoThe percentage of interpolation, between 0 and 1.
p0numberNoThe start point.
p1numberNoThe first control point.
p2numberNoThe second control point.
p3numberNoThe end point.

Returns: number - The interpolated value.

Source: src/math/interpolation/CubicBezierInterpolation.js#L43
Since: 3.0.0


Linear

<static> Linear(v, k)

Description:

A linear interpolation method.

Parameters:

nametypeoptionaldescription
vArray.<number>NoThe input array of values to interpolate between.
knumberNoThe percentage of interpolation, between 0 and 1.

Returns: number - The interpolated value.

Source: src/math/interpolation/LinearInterpolation.js#L9
Since: 3.0.0


QuadraticBezier

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

Description:

A quadratic bezier interpolation method.

Parameters:

nametypeoptionaldescription
tnumberNoThe percentage of interpolation, between 0 and 1.
p0numberNoThe start point.
p1numberNoThe control point.
p2numberNoThe end point.

Returns: number - The interpolated value.

Source: src/math/interpolation/QuadraticBezierInterpolation.js#L35
Since: 3.2.0


SmootherStep

<static> SmootherStep(t, min, max)

Description:

A Smoother Step interpolation method.

Parameters:

nametypeoptionaldescription
tnumberNoThe percentage of interpolation, between 0 and 1.
minnumberNoThe minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.
maxnumberNoThe maximum value, also known as the 'right edge', assumed greater than the 'left edge'.

Returns: number - The interpolated value.

Source: src/math/interpolation/SmootherStepInterpolation.js#L9
Since: 3.9.0


SmoothStep

<static> SmoothStep(t, min, max)

Description:

A Smooth Step interpolation method.

Parameters:

nametypeoptionaldescription
tnumberNoThe percentage of interpolation, between 0 and 1.
minnumberNoThe minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.
maxnumberNoThe maximum value, also known as the 'right edge', assumed greater than the 'left edge'.

Returns: number - The interpolated value.

Source: src/math/interpolation/SmoothStepInterpolation.js#L9
Since: 3.9.0