Last active
February 5, 2019 13:24
-
-
Save pervognsen/ce0eac7f073a9b5b73a90907bdf4617f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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