just so much groundwork
This commit is contained in:
15
math/lerp.ts
15
math/lerp.ts
@@ -1,8 +1,11 @@
|
||||
import { Vector } from "doodler";
|
||||
|
||||
export const lerp = (a: number, b: number, t: number) => {
|
||||
return (a*t) + (b*(1-t));
|
||||
}
|
||||
return (a * t) + (b * (1 - t));
|
||||
};
|
||||
|
||||
export const map = (value: number, x1: number, y1: number, x2: number, y2: number) =>
|
||||
(value - x1) * (y2 - x2) / (y1 - x1) + x2;
|
||||
export const map = (
|
||||
value: number,
|
||||
x1: number,
|
||||
y1: number,
|
||||
x2: number,
|
||||
y2: number,
|
||||
) => (value - x1) * (y2 - x2) / (y1 - x1) + x2;
|
||||
|
Reference in New Issue
Block a user