MathUtils

open class MathUtils

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun clamp(value: Double, min: Double, max: Double): Double
open fun clamp(value: Float, min: Float, max: Float): Float
Test a value in specified range, returning minimum if it's below, and maximum if it's above
Link copied to clipboard
open fun normalize(x: Double, dataLow: Double, dataHigh: Double, normalizedLow: Double, normalizedHigh: Double): Double
Scale a value from an arbitrary range to a normalized range.
Link copied to clipboard
open fun wrap(value: Double, min: Double, max: Double): Double
Constrains value to the given range (including min, excluding max) via modular arithmetic.