export default class Mathf {

    public static Clamp(value: number, min: number, max: number) {
        if (value < min) return min;
        if (value > max) return max;
        return value;
    }

    public static Clamp01(value: number) {
        return this.Clamp(value, 0, 1);
    }

    public static Lerp(from: number, to: number, t: number) {
        let value = to - from;
        value = from + value * t;
        return value;
    }
}