--- title: Frequently used functions ---
It's good to be aware of these functions which apply to many drawing scenarios. Also, browse the APIs of each module for lesser used specialized functions.
Add two points together and return the result as a new point.
Subtract a point from another point and return the result as a new point.
Get the average of two points and return the result as a new point.
Get a point from its polar coordinates: angle (in radians) and radius.
Given a reference point and an array of points, find the closest point in the array to the reference point.
Proportionately scale a point and return the result as a new point.
Disproportionately scale a point and return the result as a new point.
Rotate a point and return the result as a new point.
Return the two end points of a given path (null if path is a circle).
Convert an angle from radians to degrees.
Convert an angle from degrees to radians.
Given a line, returns its angle in degrees.
Given two points, returns the angle of the line through them, in degrees.
Given two points, returns the angle of the line through them, in radians.
Given a polar angle in degrees, returns the same angle cast between -360 and 360. For example, 725 degrees = 5 degrees.
Given an arc, returns total angle span between its start and end angles.
Calculates the distance between two points using the Pythagorean theorem.
Measures the length of a path.
Given two points, determine if they are equal within a distance of accuracy.
Given two measurements, determine if they are overlapping. Also known as "bounding box overlap".
Given two angles, determine if they are equal within a margin of accuracy.