ee.Number.unitScale

Scales the input so that the range of input values [min, max] becomes [0, 1]. Values outside the range are NOT clamped. If min == max, 0 is returned.

UsageReturns
Number.unitScale(min, max)Number
ArgumentTypeDetails
this: numberNumber

minFloat

maxFloat

Examples

Code Editor (JavaScript)

print('-10 scaled between [0, 100]', ee.Number(-10).unitScale(0, 100));  // -0.1
print('10 scaled between [0, 100]', ee.Number(10).unitScale(0, 100));  // 0.1