modulate

Public Function

Modulate a value between two ranges.

Example
const A = modulate(0, [0, 1], [0, 100])
Parameters
NameDescription

value

number

The interpolation value.

rangeA

number[]

From [low, high]

rangeB

number[]

To [low, high]

clamp

(optional)

boolean

Whether to clamp the the result to [low, high]

Returns
number
Edit this page
Last edited on 15 June 2023
lnsOkResult