We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4409a24 commit 5864facCopy full SHA for 5864fac
viscm/bezierbuilder.py
@@ -34,7 +34,7 @@
34
"""
35
36
import numpy as np
37
-from scipy.special import binom
+from math import factorial
38
39
import matplotlib
40
import matplotlib.pyplot as plt
@@ -173,6 +173,11 @@ def _refresh(self):
173
self.bezier_curve.set_data(x, y)
174
self.canvas.draw()
175
176
+# We used to use scipy.special.binom here, but reimplementing it ourself lets
177
+# us avoid pulling in a dependency scipy just for that one function.
178
+def binom(n, k):
179
+ return factorial(n) * 1.0 / (factorial(k) * factorial(n - k))
180
+
181
def Bernstein(n, k):
182
"""Bernstein polynomial.
183
0 commit comments