math_utils library

Classes

Point
Rectangle
Result
Unistroke

Constants

NUMPOINTS → const int
64
origin → const Point
const Point(0, 0)
SQUARESIZE → const double
250.0

Properties

angleprecision double
final
anglerange double
final
diagonal double
final
halfdiagonal double
final
infinity int
final
phi double
final

Functions

boundingBox(List<Point> points) Rectangle
centroid(List<Point> points) Point
deg2Rad(dynamic d) double
distance(Point p1, Point p2) double
distanceAtAngle(List<Point> points, Unistroke T, dynamic radians) double
distanceAtBestAngle(List<Point> points, Unistroke T, double a, double b, dynamic threshold) double
indicativeAngle(List<Point> points) double
optimalCosineDistance(List<double> v1, List<double> v2) double
pathDistance(List<Point> pts1, List<Point> pts2) double
pathLength(List<Point> points) double
resample(List<Point> points, int numPoints) List<Point>
Private helper functions from here on down
rotateBy(List<Point> points, dynamic radians) List<Point>
scaleTo(List<Point> points, double size) List<Point>
non-uniform scale; assumes 2D gestures (i.e., no lines)
translateTo(List<Point> points, Point pt) List<Point>
translates points' centroid
vectorize(List<Point> points) List<double>
for Protractor