Scott David Daniels wrote: > Your equation for y uses the new x, not the old x. Be more free with > names. Here's one way to write it: > > class ... > def rotate(self, angle): > '''Rotate point angle radians around relPoint''' > x, y = self.coords > xRel, yRel = self.relPoint > sin, cos = math.sin(angle), math.cos(angle) > newx = x * cos - y * sin - xRel * cos + yRel * sin + xRel > newy = x * sin + y * cos - xRel * sin - yRel * cos + yRel > self.coords = newx, newy
and here's another one: http://online.effbot.org/2004_09_01_archive.htm#tkinter-complex </F> -- http://mail.python.org/mailman/listinfo/python-list