1 | ;
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.createNormalize = void 0;
|
4 | /**
|
5 | * 返回一个 normalize 函数,该函数将输入的 t 从 [a, b] 线性变换到 [0, 1]
|
6 | * @param a 输入 t 的最小值
|
7 | * @param b 输入 t 的最大值
|
8 | * @returns normalize 函数
|
9 | */
|
10 | function 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 | }
|
14 | exports.createNormalize = createNormalize;
|
15 | //# sourceMappingURL=normalize.js.map |
\ | No newline at end of file |