def preRotate(self, theta):
while theta < <NUM_LIT:0>: theta += <NUM_LIT><EOL>while theta >= <NUM_LIT>: theta -= <NUM_LIT><EOL>epsilon = <NUM_LIT><EOL>if abs(<NUM_LIT:0> - theta) < epsilon:<EOL><INDENT>pass<EOL><DEDENT>elif abs(<NUM_LIT> - theta) < epsilon:<EOL><INDENT>a = self.a<EOL>b = self.b<EOL>self.a = self.c<EOL>self.b = self.d<EOL>self.c = -a<EOL>self.d = -b<EOL><DEDENT>elif abs(<NUM_LIT> - theta) < epsilon:<EOL><INDENT>self.a = -self.a<EOL>self.b = -self.b<EOL>self.c = -self.c<EOL>self.d = -self.d<EOL><DEDENT>elif abs(<NUM_LIT> - theta) < epsilon:<EOL><INDENT>a = self.a<EOL>b = self.b<EOL>self.a = -self.c<EOL>self.b = -self.d<EOL>self.c = a<EOL>self.d = b<EOL><DEDENT>else:<EOL><INDENT>rad = math.radians(theta)<EOL>s = round(math.sin(rad), <NUM_LIT:12>)<EOL>c = round(math.cos(rad), <NUM_LIT:12>)<EOL>a = self.a<EOL>b = self.b<EOL>self.a = c * a + s * self.c<EOL>self.b = c * b + s * self.d<EOL>self.c =-s * a + c * self.c<EOL>self.d =-s * b + c * self.d<EOL><DEDENT>return self<EOL>
Calculate pre rotation and replace current matrix.