import math import numpy rot = numpy.empty( (2,2) ) angle = 30. * math.pi/180. rot[0][0] = math.cos(angle) rot[0][1] = math.sin(angle) rot[1][0] = -math.sin(angle) rot[1][1] = math.cos(angle) print rot print " " a = numpy.zeros( (18,2) ) angle = 0. incr = 2*math.pi/ 18. for i in range(18): a[i][0] = math.cos(angle) a[i][1] = math.sin(angle) angle += incr print a print " " #print numpy.round(a, 5) print a.round(3) print " " b = numpy.dot(a,rot) # multiply points by the rotation matrix b = 2. * b # scale the rotated points by 2 print b print " " #print numpy.round(b, 5) print b.round(3) import matplotlib.pyplot as plt # import can be anywhere in program plt.plot(a[:,0], a[:,1]) # every row, first column; X values plt.plot(b[:,0], b[:,1]) # every row, second column; Y values plt.show()