Conventions A = [xA, yA] is a point on the 2D plane. Same for B, C, ... lengths are in any unit (ex: pixels) code snippets are in JavaScript Degrees to radians angleRad = angleDeg * Math.PI / 180;