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

map(num, low1, high1, low2, high2)

Re-maps a number from one range to another. 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
low1Lower bound of the value's current range
high1Upper bound of the value's current range
low2Lower bound of the value's target range
high2Upper bound of the value's target range

Want to join the conversation?

No posts yet.