Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9008c5c

Browse filesBrowse files
committed
revert BezierSegment changes, not for this PR
1 parent db4125e commit 9008c5c
Copy full SHA for 9008c5c

File tree

Expand file treeCollapse file tree

1 file changed

+6
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-7
lines changed

‎lib/matplotlib/bezier.py

Copy file name to clipboardExpand all lines: lib/matplotlib/bezier.py
+6-7Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,12 @@ class BezierSegment:
225225
"""
226226

227227
def __init__(self, control_points):
228-
self.cpoints = np.asarray(control_points)
229-
self.n, self.d = self.cpoints.shape
230-
self._orders = np.arange(self.n)
231-
coeff = [math.factorial(self.n - 1)
232-
// (math.factorial(i) * math.factorial(self.n - 1 - i))
233-
for i in range(self.n)]
234-
self._px = self.cpoints.T * coeff
228+
n = len(control_points)
229+
self._orders = np.arange(n)
230+
coeff = [math.factorial(n - 1)
231+
// (math.factorial(i) * math.factorial(n - 1 - i))
232+
for i in range(n)]
233+
self._px = np.asarray(control_points).T * coeff
235234

236235
def point_at_t(self, t):
237236
"""Return the point on the Bezier curve for parameter *t*."""

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.