lemon_math library Null safety

Classes

Vector2

Mixins

Position

Constants

degreesToRadians → const double
0.0174533
pi2 → const double
pi + pi
piEighth → const double
pi / 8
piHalf → const double
pi / 2
piQuarter → const double
pi / 4.0
radiansToDegrees → const double
57.2958

Properties

random Random
final

Functions

clamp<T extends num>(T value, T min, T max) → T
clamp01(double value) double
clampAngle(double angle) double
diff(num a, num b) num
diffOver(num a, num b, num over) bool
diffUnder(num a, num b, num under) bool
distanceBetween(double x1, double y1, double x2, double y2) double
findClosest<T extends Position>(List<T> values, double x, double y) → T
getAdjacent(double angle, double magnitude) double
Angle in radians
getAngle(double adjacent, double opposite) double
radians
getAngleBetween(double x1, double y1, double x2, double y2) double
Returns the angle in radians between two positions
getHypotenuse(num adjacent, num opposite) double
Pythagoras Theorem
getOpposite(double angle, double magnitude) double
giveOrTake(num value) double
insertionSort<E>(List<E> list, {required int compare(E, E), int start = 0, int? end}) → void
normalize(double x, double y) double
randomAngle() double
randomBetween(num a, num b) double
randomBool() bool
randomInt(int min, int max) int
randomItem<T>(List<T> list) → T
sortSum(List<Position> items) → void
sortVertically(List<Position> items) → void