MathUtils class
Class with various math helpers.
@author {@link https://github.com/Mugen87|Mugen87}
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
area(
Vector3 a, Vector3 b, Vector3 c) → double - Computes the signed area of a rectangle defined by three points. This method can also be used to calculate the area of a triangle.
-
argmax(
List< double> array) → List<int> - Returns the indices of the maximum values of the given array.
-
choice(
List array, [List< double> ? probabilities]) → dynamic - Returns a random sample from a given array.
-
clamp(
double value, double min, double max) → double - Ensures the given scalar value is within a given min/max range.
-
clampInt(
int value, int min, int max) → int -
generateUUID(
) → String - Computes a RFC4122 Version 4 complied Universally Unique Identifier (UUID).
-
getMaxFromArray(
List< double> array) → double -
randFloat(
double min, double max) → double - Computes a random float value within a given min/max range.
-
randInt(
int min, int max) → int - Computes a random integer value within a given min/max range.