def rotate_point(center, point, angle): m21 = math.sin(angle) m11 = m22 = math.cos(angle) m12 = -m21 dx = center[0] - m11 * center[0] + m21 * center[1] dy = center[1] - m21 * center[0] - m11 * center[1] trafo = [m11, m21, m12, m22, dx, dy] return apply_trafo_to_point(point, trafo)
def rotate_point(center, point, angle): m21 = math.sin(angle) m11 = m22 = math.cos(angle) m12 = -m21 dx = center[0] - m11 * center[0] + m21 * center[1]; dy = center[1] - m21 * center[0] - m11 * center[1]; trafo = [m11, m21, m12, m22, dx, dy] return apply_trafo_to_point(point, trafo)