angle = (pt1, pt2, pt3) => {
  const vec1 = sub(pt1, pt2), vec2 = sub(pt3, pt2);
  const convexAngle = Math.acos(dot(vec1, vec2)/(norm(vec1)*norm(vec2)));
  const outerProduct = outer(vec1, vec2);
  return outerProduct > 0 ? convexAngle : 2 * Math.PI - convexAngle;
}
Angle specified by three points: point on edge 1, vertex, point on edge 2.
The angle is in rad and goes counterclock-wise.
@type { (pt1: PointTuple, pt2: PointTuple, pt3: PointTuple) => number }