export class LinearScale {
    #min;
    #max;
    #range;
    #rangeInv;
    constructor(min, max) {
        this.#min = min;
        this.#max = max;
        this.#range = max - min;
        this.#rangeInv = 1.0 / this.#range;
    }
    get min() { return this.#min; }
    get max() { return this.#max; }
    normToUnit(norm) { return this.#min + norm * this.#range; }
    unitToNorm(unit) { return (unit - this.#min) * this.#rangeInv; }
}
export class LogScale {
    #min;
    #max;
    #range;
    #logMin;
    #logRangeInv;
    constructor(min, max) {
        this.#min = min;
        this.#max = max;
        this.#range = Math.log(max / min);
        this.#logMin = Math.log(min);
        this.#logRangeInv = 1.0 / (Math.log(max) - this.#logMin);
    }
    get min() { return this.#min; }
    get max() { return this.#max; }
    normToUnit(norm) { return this.#min * Math.exp(norm * this.#range); }
    unitToNorm(unit) { return (Math.log(unit) - this.#logMin) * this.#logRangeInv; }
}
