MathUtils class

Constructors

MathUtils()

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 Properties

LOG_10 double
final

Static Methods

average(double x1, double x2) double
Computes the average of two numbers.
clamp(num x, num min, num max) num
Clamps a double value to a given range. @param x the value to clamp @param min the minimum value of the range @param max the maximum value of the range @return the clamped value
log10(double x) double
Computes the base-10 logarithm of a double value.
max(double v1, double v2, double v3) double
max4(double v1, double v2, double v3, double v4) double
min(double v1, double v2, double v3, double v4) double
wrap(int index, int max) int
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