@ff6347/p5-easingDocs


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

Linear in easing function

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 = easeInLinear(frameCount % duration, start, end, duration);
const y = frameCount % duration;
circle(x, y, 10);
}

Defined in

../src/easing/linear.ts:32