object MathUtil
Various utility functions for mathematical and numerical operations.
- Alphabetic
- By Inheritance
- MathUtil
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def average(x1: Double, x2: Double): Double
Computes the average of two numbers.
Computes the average of two numbers.
- x1
a number
- x2
a number return the average of the inputs
- def clamp(x: Int, min: Int, max: Int): Int
Clamps an int value to a given range.
Clamps an int value to a given range.
- x
the value to clamp
- min
the minimum value of the range
- max
the maximum value of the range return the clamped value
- def clamp(x: Double, min: Double, max: Double): Double
Clamps a double value to a given range.
Clamps a double value to a given range.
- x
the value to clamp
- min
the minimum value of the range
- max
the maximum value of the range return the clamped value
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def log10(x: Double): Double
Computes the base-10 logarithm of a double value.
Computes the base-10 logarithm of a double value.
- If the argument is NaN or less than zero, then the result is NaN.
- If the argument is positive infinity, then the result is positive infinity.
- If the argument is positive zero or negative zero, then the result is negative infinity.
- x
a positive number return the value log a, the base-10 logarithm of the input value
- def max(v1: Double, v2: Double, v3: Double, v4: Double): Double
- def max(v1: Double, v2: Double, v3: Double): Double
- def min(v1: Double, v2: Double, v3: Double, v4: Double): Double
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def wrap(index: Int, max: Int): Int
Computes an index which wraps around a given maximum value.
Computes an index which wraps around a given maximum value. For values >= 0, this is equals to val % max. For values < 0, this is equal to max - (-val) % max
- index
the value to wrap
- max
the maximum value (or modulus) return the wrapped index