"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.rangeMap = void 0;
function rangeMap(n, start1, stop1, start2, stop2, withinBounds = false) {
    const mapped = (n - start1) / (stop1 - start1) * (stop2 - start2) + start2;
    if (withinBounds && n < start1)
        return start2;
    if (withinBounds && n > stop1)
        return stop2;
    return mapped;
}
exports.rangeMap = rangeMap;
