7 lines
201 B
TypeScript
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)
|
||
|
}
|