Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def rotate(image, cos_angle, sin_angle):
if abs(cos_angle) < abs(sin_angle):
image, cos_angle, sin_angle = image.T, -sin_angle, cos_angle
inv_cos_angle = 1/cos_angle
yshear(image, -sin_angle)
xyscale(image, cos_angle, inv_cos_angle)
xshear(image, sin_angle * inv_cos_angle)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.