map

final static Float map(Float n, Float start1, Float stop1, Float start2, Float stop2, Boolean withBounds)

Re-maps a number from one range to another.

Return

remapped number

Parameters

value

the incoming value to be converted

start1

lower bound of the value's current range

stop1

upper bound of the value's current range

start2

lower bound of the value's target range

stop2

upper bound of the value's target range

withinBounds

constrain the value to the newly mapped range