MathUtils

open class MathUtils

Utility methods for mathematical operations.

Functions

Link copied to clipboard
open fun clampDouble(min: Double, max: Double, input: Double): Double
Clamps an integer between two floating-point numbers.
Link copied to clipboard
open fun clampInt(min: Int, max: Int, input: Int): Int
Clamps an integer between two integers.
Link copied to clipboard
Distance of two points on a circle, represented using degrees.
Link copied to clipboard
open fun lerp(start: Double, stop: Double, amount: Double): Double
The linear interpolation function.
Link copied to clipboard
open fun matrixMultiply(row: Array<Double>, matrix: Array<Array<Double>>): Array<Double>
Multiplies a 1x3 row vector with a 3x3 matrix.
Link copied to clipboard
open fun rotationDirection(from: Double, to: Double): Double
Sign of direction change needed to travel from one angle to another.
Link copied to clipboard
open fun sanitizeDegreesDouble(degrees: Double): Double
Sanitizes a degree measure as a floating-point number.
Link copied to clipboard
open fun sanitizeDegreesInt(degrees: Int): Int
Sanitizes a degree measure as an integer.
Link copied to clipboard
open fun signum(num: Double): Int
The signum function.