// Function to rotate a point [x,y] around a point [xc,yc] with the rotation // angle theta (positive specifying a counterclockwise rotation). // // The coordinates represent Frink's coordinate system, with y increasing // downward. rotate[x,y,xc,yc,theta] := { c = cos[theta] s = sin[-theta] xd = x-xc yd = yc-y xprime = xc + c xd + s yd yprime = yc + s xd - c yd return [xprime, yprime] }