@ff6347/p5-easingDocs


function easeInBack(
   time, 
   start, 
   end, 
   duration): number

back in easing function that accelerates into the animation.

Parameters

ParameterTypeDescription
timenumberThe current time.
startnumberThe start value.
endnumberThe end in value.
durationnumberThe duration of the animation.

Returns

number

The calculated value at the current time.

Example

const start = 0;
const end = 100;
const duration = 100;
function setup() {
  createCanvas(end, end);
}
function draw() {
  background(255, 10);
  const x = easeInBack(frameCount % duration, start, end, duration);
  const y = frameCount % duration;
  circle(x, y, 10);
}

Defined in

../src/easing/back.ts:30