home ~ projects ~ socials

Basic JavaScript Lerp

this is a scratch note. I'm not sure how this is supposed to work yet.

JavaScript

function lerpIt(a, b, ratio) {
  return a + ratio * (b - a);
}

const output = [];
for (let num = 0; num < 100; num ++) {
  output.push(lerpIt(0, 1.2, num));
}


const el = document.querySelector('.output');

el.innerHTML = output.join("\n");

Output

x
-- end of line --