manifold/common/util/math.ts
2022-04-09 16:39:11 -05:00

7 lines
201 B
TypeScript

export const logInterpolation = (min: number, max: number, value: number) => {
if (value <= min) return 0
if (value >= max) return 1
return Math.log(value - min + 1) / Math.log(max - min + 1)
}