If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Course: Unlisted resources area > Unit 2

Lesson 1: ProcessingJS documentation

norm(num, low, high)

Normalizes a number from another range into a value between 0 and 1. This is the same as using the map function with the last two parameters set to 0 and 1, i.e:
map(num, low, high, 0, 1);
Numbers outside the range are not clamped to 0 and 1, because out-of-range values are often intentional and useful.
Parameters:
NameDescription
numThe incoming value to be converted
lowLower bound of the value's current range
highUpper bound of the value's current range

Want to join the conversation?

No posts yet.