given a point A = (a1,a2) relative to the point 0 = (0,0) in the plane and a counter clockwise rotation of R degrees, your rotation is given by

A' = (a1 x cos R - a2 x sin R, a1 x cos R + a2 sin R) // counterclockwise

A'' = (a1 x cosR + a2 x sin R, a1 x cos R - a2 sin R) // clockwise

so to rotate any one point Q about the point P, find the vector D = (Q-P), rotate D R degrees and Add P.

p2' = p1 + ((p2-p1) rotated R degrees)

check this link

http://www.mapleapps.com/categories/maple_tools/animations/html/clock1.html