Mathf
Functions
Link copied to clipboard
Wraps an angle to the range -pi to pi radians.
Link copied to clipboard
Returns 0.0 if the given value is within the specified range around zero.
Link copied to clipboard
Link copied to clipboard
Returns the closest power of two that is equal to or larger than the specified value.
Link copied to clipboard
Link copied to clipboard
Returns modulus of input.
Link copied to clipboard
Perform linear interpolation between two values.
Link copied to clipboard
Perform linear interpolation like interpolate, but interpolates correctly when they wrap around 1 revolution (360 degrees).
Link copied to clipboard
Perform linear interpolation between two values.
Link copied to clipboard
Return where within interpolation range [0, 1] q is between startValue and endValue.
Link copied to clipboard
Returns whether the given value is a power of two.
Link copied to clipboard
Find the intersection of two lines.
Link copied to clipboard
Find the intersection of two line segments.
Link copied to clipboard
Moves a value
current
towards target
.Link copied to clipboard
open fun moveTowardsAngle(current: Measure<Angle>, target: Measure<Angle>, maxDelta: Measure<Angle>): Measure<Angle>
Same as moveTowards, but makes sure the values interpolate correctly when they wrap around 1 revolution (360 degrees).
Link copied to clipboard
Returns the next power of two that is equal to or larger than the specified value.
Link copied to clipboard
Normalizes the given angle to be within the range of [0, 2pi].
Link copied to clipboard
open fun smoothDamp(current: Double, target: Double, @NonNull currentVelocity: Reference<Double>, smoothTime: Measure<Time>, maxVelocity: Double, deltaTime: Measure<Time>): Double
open fun smoothDamp(current: Float, target: Float, currentVelocity: Reference<Double>, smoothTime: Measure<Time>, maxVelocity: Float, deltaTime: Measure<Time>): Float
Gradually changes a value towards a desired goal over time.
Link copied to clipboard
Link copied to clipboard
Interpolates between min and max with smoothing at the limits.
Link copied to clipboard