8000 use math indest np for scalars · matplotlib/matplotlib@17fc9e1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 17fc9e1

Browse files
committed
use math indest np for scalars
1 parent 5be294e commit 17fc9e1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/matplotlib/transforms.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1914,8 +1914,8 @@ def rotate(self, theta):
19141914
calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
19151915
and :meth:`scale`.
19161916
"""
1917-
a = np.cos(theta)
1918-
b = np.sin(theta)
1917+
a = math.cos(theta)
1918+
b = math.sin(theta)
19191919
rotate_mtx = np.array([[a, -b, 0.0], [b, a, 0.0], [0.0, 0.0, 1.0]],
19201920
float)
19211921
self._mtx = np.dot(rotate_mtx, self._mtx)
@@ -1930,7 +1930,7 @@ def rotate_deg(self, degrees):
19301930
calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
19311931
and :meth:`scale`.
19321932
"""
1933-
return self.rotate(np.deg2rad(degrees))
1933+
return self.rotate(math.radians(degrees))
19341934

19351935
def rotate_around(self, x, y, theta):
19361936
"""
@@ -2002,8 +2002,8 @@ def skew(self, xShear, yShear):
20022002
calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
20032003
and :meth:`scale`.
20042004
"""
2005-
rotX = np.tan(xShear)
2006-
rotY = np.tan(yShear)
2005+
rotX = math.tan(xShear)
2006+
rotY = math.tan(yShear)
20072007
skew_mtx = np.array(
20082008
[[1.0, rotX, 0.0], [rotY, 1.0, 0.0], [0.0, 0.0, 1.0]], float)
20092009
self._mtx = np.dot(skew_mtx, self._mtx)
@@ -2021,7 +2021,7 @@ def skew_deg(self, xShear, yShear):
20212021
calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
20222022
and :meth:`scale`.
20232023
"""
2024-
return self.skew(np.deg2rad(xShear), np.deg2rad(yShear))
2024+
return self.skew(math.radians(xShear), math.radians(yShear))
20252025

20262026

20272027
class IdentityTransform(Affine2DBase):

0 commit comments

Comments
 (0)
0