You may use the following function:
def Rotate2D(pts,cnt,ang=pi/4):
'''pts = {} Rotates points(nx2) about center cnt(2) by angle ang(1) in radian'''
return dot(pts-cnt,ar([[cos(ang),sin(ang)],[-sin(ang),cos(ang)]]))+cnt
It works well as can be seen in the following figures:
about the anchor point on (0,0):
about the anchor point on (1,0):
about the anchor point on (0.5,0.5):
Update:
Well here is the full code, you must be able to generate the exact results as here:
from __future__ import division #to avoid integer devision problem
import scipy
import pylab
#just for fun making further development easier and with joy
pi = scipy.pi
dot = scipy.dot
sin = scipy.sin
cos = scipy.cos
ar = scipy.array
rand = scipy.rand
arange = scipy.arange
plot = pylab.plot
show = pylab.show
axis = pylab.axis
grid = pylab.grid
title = pylab.title
rad = lambda ang: ang*pi/180 #lovely lambda: degree to radian
#the function
def Rotate2D(pts,cnt,ang=pi/4):
'''pts = {} Rotates points(nx2) about center cnt(2) by angle ang(1) in radian'''
return dot(pts-cnt,ar([[cos(ang),sin(ang)],[-sin(ang),cos(ang)]]))+cnt
#the code for test
pts = ar([[0,0],[1,0],[1,1],[0.5,1.5],[0,1]])
plot(*pts.T,lw=5,color='k') #points (poly) to be rotated
for ang in arange(0,2*pi,pi/8):
ots = Rotate2D(pts,ar([0.5,0.5]),ang) #the results
plot(*ots.T)
axis('image')
grid(True)
title('Rotate2D about a point')
show()
The results are:

Good luck!
Appendices:
>>> pts
array([[ 0. , 0. ],
[ 1. , 0. ],
[ 1. , 1. ],
[ 0.5, 1.5],
[ 0. , 1. ]])
>>> pts.shape
(5, 2)
>>> anchor = ar([0.5,0.5])
>>> anchor
array([ 0.5, 0.5])
>>> ots = Rotate2D(pts,anchor,ang=rad(45))
>>> ots
array([[ 0.5 , -0.20710678],
[ 1.20710678, 0.5 ],
[ 0.5 , 1.20710678],
[-0.20710678, 1.20710678],
[-0.20710678, 0.5 ]])
>>> ots.shape
(5, 2)
>>> '''a single point'''
'a single point'
>>> pts = ar([3.1,1.3])
>>> pts.shape
(2,)
>>> ots = Rotate2D(pts,anchor,ang=rad(30))
>>> ots
array([ 2.35166605, 2.49282032])
>>> ots.shape
(2,)
>>> dts = ots.reshape(-1,2)
>>> dts
array([[ 2.35166605, 2.49282032]])
>>> dts.shape
(1, 2)