A community-maintained Python framework for creating mathematical animations.
made not_quite_there alpha_func more general
Grant Sanderson7f45044bafb2
diff --git a/helpers.py b/helpers.pyindex 106aea360..9f1b1c0a3 100644--- a/helpers.py+++ b/helpers.py@@ -257,8 +257,11 @@ def there_and_back(t, inflection = 10.0):new_t = 2*t if t < 0.5 else 2*(1 - t)return smooth(new_t, inflection)-def not_quite_there(t, proportion = 0.7):- return proportion*smooth(t)++def not_quite_there(func = smooth, proportion = 0.7):+ def result(t):+ return proportion*func(t)+ return resultdef wiggle(t, wiggles = 2):return there_and_back(t) * np.sin(wiggles*np.pi*t)