import { inverseLerp } from "../../inverseLerp.js";

/**
 *
 * @param {number} distance
 * @param {number} min
 * @param {number} max
 * @returns {number}
 */
export function interpolate_irradiance_linear(distance, min, max) {
    if (distance <= min) {
        return 1;
    } else if (distance >= max) {
        return 0;
    } else {
        return inverseLerp(max, min, distance);
    }
}
