MCPcopy
hub / github.com/KilledByAPixel/LittleJS / lerp

Function lerp

src/engineMath.js:134–135  ·  view source on GitHub ↗

Linearly interpolates between values passed in using percent * @param {number} valueA * @param {number} valueB * @param {number} percent * @return {number} * @memberof Math

(valueA, valueB, percent)

Source from the content-addressed store, hash-verified

132 * @return {number}
133 * @memberof Math */
134function lerp(valueA, valueB, percent)
135{ return valueA + clamp(percent) * (valueB-valueA); }
136
137/** Gets percent between percentA and percentB and linearly interpolates between lerpA and lerpB
138 * A shortcut for lerp(lerpA, lerpB, percent(value, percentA, percentB))

Callers 10

math.test.mjsFile · 0.90
drawEngineLogoFunction · 0.85
noise1DFunction · 0.85
noise2DFunction · 0.85
engineUpdateFunction · 0.85
percentLerpFunction · 0.85
updatePhysicsMethod · 0.85
renderMethod · 0.85
renderMethod · 0.85
gameInitFunction · 0.85

Calls 1

clampFunction · 0.85

Tested by

no test coverage detected