wrap

fun wrap(value: Double, min: Double, max: Double): Double

Constrains value to the given range (including min & max) via modular arithmetic.

Same formula as used in Core GL (wrap.hpp) std::fmod((std::fmod((value - min), d) + d), d) + min;

Multiples of max value will be wrapped to max.

Return

Wrapped value

Parameters

value

Value to wrap

min

Minimum value

max

Maximum value