def rotate(self, theta): """Canvas.rotate(theta) Rotate the canvas by the angle theta (in degrees).""" c = cos(theta * pi / 180) s = sin(theta * pi / 180) self.transform(c, s, -s, c, 0, 0)