GameMath class

Provides convenience methods for calculations often carried out in graphics. Some of the methods are returning approximations.

Constructors

GameMath()

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

atan2(double y, double x) double
Returns the angle of two vector components. The result is less acurate than the standard atan2 function in the math package.
distanceBetweenPoints(Offset a, Offset b) double
Approximates the distance between two points. The returned value can be up to 6% wrong in the worst case.
filter(double a, double b, double filterFactor) double
Interpolates a double between a and b according to the filterFactor, which should be in the range of 0.0 to 1.0.
filterPoint(Offset a, Offset b, double filterFactor) Offset
Interpolates a Point between a and b according to the filterFactor, which should be in the range of 0.0 to 1.0.
lineIntersection(Offset p0, Offset p1, Offset q0, Offset q1) Offset?
Returns the intersection between two line segmentss defined by p0, p1 and q0, q1. If the lines are not intersecting null is returned.