def setRotation(self, rot, smallangle=True):
'''
Rotation angle in degrees
'''
rad = np.deg2rad(rot)
if smallangle:
# bring rad close to zero.
rad = np.fmod(rad, 2.*pi)
if rad > pi:
rad -= 2.*pi
if rad < -pi:
rad += 2.*pi
self.T = [ 0., -rad, rad, 0. ]
else:
cr = np.cos(rad)
sr = np.sin(rad)
self.T = [ cr - 1, -sr, sr, cr - 1 ]
评论列表
文章目录