Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 87c668a

Browse files
committed
Remove unnecessary math in Path.arc.
These trig bits were necessary to properly scale by major and minor axes for an ellipse, but this method only supports circular arcs.
1 parent a1937d4 commit 87c668a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/matplotlib/path.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -864,14 +864,11 @@ def arc(cls, theta1, theta2, n=None, is_wedge=False):
864864
polylines, quadratic or cubic Bezier curves
865865
<http://www.spaceroots.org/documents/ellipse/index.html>`_.
866866
"""
867-
theta1, theta2 = np.deg2rad([theta1, theta2])
868-
869-
twopi = np.pi * 2.0
870867
halfpi = np.pi * 0.5
871868

872-
eta1 = np.arctan2(np.sin(theta1), np.cos(theta1))
873-
eta2 = np.arctan2(np.sin(theta2), np.cos(theta2))
874-
eta2 -= twopi * np.floor((eta2 - eta1) / twopi)
869+
eta1 = theta1
870+
eta2 = theta2 - 360 * np.floor((theta2 - theta1) / 360)
871+
eta1, eta2 = np.deg2rad([eta1, eta2])
875872

876873
# number of curve segments to make
877874
if n is None:

0 commit comments

Comments
 (0)