MathUtil class

Constructors

MathUtil()

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

arcHav(num x) num
Computes inverse haversine. Has good numerical stability around 0. arcHav(x) == acos(1 - 2 * x) == 2 * asin(sqrt(x)). The argument must be in 0, 1, and the result is positive.
hav(num x) num
Returns haversine(angle-in-radians). hav(x) == (1 - cos(x)) / 2 == sin(x / 2)^2.
havDistance(num lat1, num lat2, num dLng) num
Returns hav() of distance from (lat1, lng1) to (lat2, lng2) on the unit sphere.
mod(num x, num m) num
Returns the non-negative remainder of x / m. @param x The operand. @param m The modulus.
toDegrees(num rad) num
toRadians(num degrees) num
wrap(num n, num min, num max) num
Wraps the given value into the inclusive-exclusive interval between min and max. @param n The value to wrap. @param min The minimum. @param max The maximum.