Rotate about a point

Almost everyone ends up wanting a function to rotate around a point. (rotate() rotates around the origin.) Stick this function in your sketch, and then you can use it as though it were built into p5.js.

function rotateAbout(angle, x, y) {
   translate(x, y);
   rotate(angle);
   translate(-x, -y);
 }