MathUtils

object MathUtils

Functions

Link copied to clipboard
fun clamp(value: Double, min: Double, max: Double): Double

Test a value in specified range, returning minimum if it's below, and maximum if it's above

Link copied to clipboard

Returns the smallest angle between two angles.

Link copied to clipboard
fun wrap(value: Double, min: Double, max: Double): Double

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