UNPKG

548 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.createNormalize = void 0;
4/**
5 * 返回一个 normalize 函数,该函数将输入的 t 从 [a, b] 线性变换到 [0, 1]
6 * @param a 输入 t 的最小值
7 * @param b 输入 t 的最大值
8 * @returns normalize 函数
9 */
10function createNormalize(a, b) {
11 // eslint-disable-next-line @typescript-eslint/no-unused-vars
12 return b - a ? (t) => (t - a) / (b - a) : (_) => 0.5;
13}
14exports.createNormalize = createNormalize;
15//# sourceMappingURL=normalize.js.map
\No newline at end of file