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

Skip to content

Commit 9510762

Browse files
Rework imports
1 parent 2eeaa51 commit 9510762

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/matplotlib/bezier.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44

55
from functools import lru_cache
6-
from math import comb, factorial
6+
import math
77
import warnings
88

99
import numpy as np
@@ -22,7 +22,7 @@ def _get_coeff_matrix(n):
2222
coefficient.
2323
"""
2424
def _comb(n, k):
25-
return np.vectorize(comb)(n, k)
25+
return np.vectorize(math.comb)(n, k)
2626

2727
j = np.arange(n + 1)[:, None]
2828
i = np.arange(n + 1)[None, :] # _comb is non-zero for i <= j
@@ -211,8 +211,8 @@ def __init__(self, control_points):
211211
self._cpoints = np.asarray(control_points)
212212
self._N, self._d = self._cpoints.shape
213213
self._orders = np.arange(self._N)
214-
coeff = [factorial(self._N - 1)
215-
// (factorial(i) * factorial(self._N - 1 - i))
214+
coeff = [math.factorial(self._N - 1)
215+
// (math.factorial(i) * math.factorial(self._N - 1 - i))
216216
for i in range(self._N)]
217217
self._px = (self._cpoints.T * coeff).T
218218

0 commit comments

Comments
 (0)