@ff6347/p5-easingDocs


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

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

Defined in

../src/easing/sine.ts:86