import { Vector2 } from "./Vector2.js";
import { Vector3 } from "./Vector3.js";
import { Vector4 } from "./Vector4.js";
export function clamp(value, min = 0, max = 1) {
    if (min > max)
        throw new RangeError("min must be <= max");
    return Math.min(max, Math.max(min, value));
}
export function lerp(a, b, t) {
    return a + (b - a) * t;
}
export function inverseLerp(a, b, value) {
    if (a === b)
        throw new RangeError("inverseLerp requires distinct endpoints");
    return (value - a) / (b - a);
}
export function smoothstep(edge0, edge1, value) {
    const t = clamp(inverseLerp(edge0, edge1, value));
    return t * t * (3 - 2 * t);
}
export function lerpVector2(a, b, t) {
    return a.lerp(b, t);
}
export function lerpVector3(a, b, t) {
    return a.lerp(b, t);
}
export function lerpVector4(a, b, t) {
    return a.lerp(b, t);
}
//# sourceMappingURL=Interpolation.js.map