round results of sin and cos functions because there is no possible

float-point value of radians which cos will exactly 0.
This commit is contained in:
homm 2016-06-02 11:24:45 +03:00
parent 8203a43d26
commit 7687ce829e

View File

@ -1583,10 +1583,10 @@ class Image(object):
if expand:
import math
angle = -angle * math.pi / 180
angle = - math.radians(angle)
matrix = [
math.cos(angle), math.sin(angle), 0.0,
-math.sin(angle), math.cos(angle), 0.0
round(math.cos(angle), 15), round(math.sin(angle), 15), 0.0,
round(-math.sin(angle), 15), round(math.cos(angle), 15), 0.0
]
def transform(x, y, matrix=matrix):