Numeric helpers: math, normalization and aggregation.
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
-
average(
Iterable< num> values) → double -
Average of
values. Returns 0 for an empty collection. -
clamp(
num value, num min, num max) → num -
Clamps
valuebetweenminandmax. -
clamp01(
double value) → double -
Clamps
valuebetween 0 and 1. -
mapRange(
num value, num inMin, num inMax, num outMin, num outMax) → num -
Re-maps
valuefrom one range to another. -
max(
Iterable< num> values) → num? -
Largest value, or
nullwhenvaluesis empty. -
min(
Iterable< num> values) → num? -
Smallest value, or
nullwhenvaluesis empty. -
normalize(
num value, num min, num max) → double -
Normalizes
valuein the rangemin–maxto0.0–1.0. -
perceTage(
num value, num total) → double -
valueas a perceTage oftotal(0–100). Returns 0 when total is 0. -
pow10(
int places) → double -
range(
Iterable< num> values) → num - Difference between the largest and smallest value. Returns 0 when empty.
-
roundTo(
num value, int places) → double -
Rounds
valuetoplacesdecimal places. -
sum(
Iterable< num> values) → num -
Sum of
values.