mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
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:
parent
8203a43d26
commit
7687ce829e
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user