package ru.kirillius.cooler.controller;

public final class ExtMath {
    private ExtMath() {
    }

    public static float clamp(float value, float max, float min) {
        if (value < min) return min;
        if (value > max) return max;
        return value;
    }

    public static float lerp(float start, float end, float t) {
        return start * (1 - t) + end * t;
    }

    public static float inverseLerp(float a, float b, float v) {
        return (v - a) / (b - a);
    }
}
