add(p1, p2) | Adds the x and y values of the two points and returns a new point. |
encloses(r1, r2, allowSharedEdges) | Calculates whether or not r2 is completely enclosed by r1. |
extend(o1, o2, keys) | Equivalent of Object.assign, which IE11 does not support. |
fastTrim(s) | Trims whitespace from the given string. |
fixPrecision(n, digits) | Trim decimal points from a number. Defaults to 3 decimal points. |
getsert(map, key, valueGenerator) | Get, or insert then get, a value from the map. |
gradient(p1, p2) | Calculates the gradient of a line between the two points. |
insertSorted(value, array, comparator, sortDescending) | Inserts the given value into the given array at a sorted location. |
intersects(r1, r2) | Calculates whether or not the two rectangles intersect. |
isAssignableFrom(object, cls) | Returns true if the given object can be considered to be an instance of the class cls . This is done by testing the proto chain of the object and checking at each level to see if the proto is an instance of the given class. |
isBoolean(s) | Returns whether or not the given value is of boolean type. |
isDate(o) | Returns whether or not the given value is of type Date |
isEmpty(o) | Returns whether or not the given object - which may be ArrayLike, or an object - is empty. |
isFunction(o) | Returns whether or not the given value is of type Function |
isNamedFunction(o) | Returns whether or not the given value is of type Function and is a named Function. |
isNumber(n) | Returns whether or not the given value is of number type. |
isObject(o) | Returns whether or not the given value is of type object |
isString(s) | Returns whether or not the given value is of string type. |
lineIntersection(l1, l2) | Compute the intersection of the two lines. |
lineLength(p1, p2) | Calculates the length of a line between the two points. |
lineRectangleIntersection(line, r) | Finds all points where the given line intersects the given rectangle. |
normal(p1, p2) | Calculates the gradient of a normal to a line between the two points. |
perpendicularLineTo(fromPoint, toPoint, length) | Calculates a line of length length that is perpendicular to the line from fromPoint to toPoint and passes through toPoint . |
pointOnLine(fromPoint, toPoint, distance) | Calculates a point on the line from fromPoint to toPoint that is distance units along the length of the line. |
quadrant(p1, p2) | Calculates the quadrant in which the angle between the two points lies. |
rotatePoint(point, center, rotation) | Rotate the given point around the given center, by the given rotation (in degrees) |
sgn(x) | Replacement for Math.sign, which IE11 does not support. |
snapToGrid(pos, grid, thresholdX, thresholdY) | Snap the given x,y to a point on the grid defined by gridX and gridY, using the given thresholds to calculate proximity to the grid. |
subtract(p1, p2) | Subtracts p2 from p1, returning a new point. |
theta(p1, p2) | Calculates the angle between the two points. |
uuid() | Generate a v4 UUID. |