Answers for "javascript linear interpolation"

20

string interpolation javascript

const age = 3
console.log(`I'm ${age} years old!`)
Posted by: Guest on May-14-2020
1

javascript lerp

export function lerp(v0, v1, amt, maxMove = 0, minDiff = 0.0001) {
	let diff = v1 - v0;
	if (maxMove > 0) {
		diff = Math.min(diff, maxMove);
		diff = Math.max(diff, -maxMove);
	}
	if (Math.abs(diff) < minDiff) {
		return v1;
	}
	return v0 + diff * amt;
};

export default lerp;
Posted by: Guest on April-26-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language