diff options
author | Norbert Preining <norbert@preining.info> | 2021-12-28 03:01:00 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-12-28 03:01:00 +0000 |
commit | ecdf859b6ce481abfd530425dcf6f0f764bd0001 (patch) | |
tree | 13bc161dc046876ac6c92fce5f9f5034ba9aa573 /graphics/asymptote/GUI/xasyTransform.py | |
parent | 790995b7e79697514364450bf9c04f1b8d500838 (diff) |
CTAN sync 202112280300
Diffstat (limited to 'graphics/asymptote/GUI/xasyTransform.py')
-rw-r--r-- | graphics/asymptote/GUI/xasyTransform.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/graphics/asymptote/GUI/xasyTransform.py b/graphics/asymptote/GUI/xasyTransform.py index 928e9011f0..cb70bf1edb 100644 --- a/graphics/asymptote/GUI/xasyTransform.py +++ b/graphics/asymptote/GUI/xasyTransform.py @@ -1,24 +1,24 @@ #!/usr/bin/env python3 -import xasy2asy as x2a -import PyQt5.QtGui as Qg -import PyQt5.QtCore as Qc -import numpy as np +import xasy2asy as xasy2asy +import PyQt5.QtGui as QtGui +import PyQt5.QtCore as QtCore +import numpy as numpy import math class xasyTransform: @classmethod def makeRotTransform(cls, theta, origin): - if isinstance(origin, Qc.QPointF) or isinstance(origin, Qc.QPoint): + if isinstance(origin, QtCore.QPointF) or isinstance(origin, QtCore.QPoint): origin = (origin.x(), origin.y()) rotMat = (math.cos(theta), -math.sin(theta), math.sin(theta), math.cos(theta)) - shift = x2a.asyTransform((0, 0, 1 - rotMat[0], -rotMat[1], -rotMat[2], 1 - rotMat[3])) * origin - return x2a.asyTransform((shift[0], shift[1], rotMat[0], rotMat[1], rotMat[2], rotMat[3])) + shift = xasy2asy.asyTransform((0, 0, 1 - rotMat[0], -rotMat[1], -rotMat[2], 1 - rotMat[3])) * origin + return xasy2asy.asyTransform((shift[0], shift[1], rotMat[0], rotMat[1], rotMat[2], rotMat[3])) @classmethod def makeScaleTransform(cls, sx, sy, origin): - if isinstance(origin, Qc.QPointF) or isinstance(origin, Qc.QPoint): + if isinstance(origin, QtCore.QPointF) or isinstance(origin, QtCore.QPoint): origin = (origin.x(), origin.y()) - shiftMat = x2a.asyTransform((0, 0, 1 - sx, 0, 0, 1 - sy)) * origin - return x2a.asyTransform((shiftMat[0], shiftMat[1], sx, 0, 0, sy)) + shiftMat = xasy2asy.asyTransform((0, 0, 1 - sx, 0, 0, 1 - sy)) * origin + return xasy2asy.asyTransform((shiftMat[0], shiftMat[1], sx, 0, 0, sy)) |