From 7f45044bafb27c94ae1b3f900014b3fbdc612e5f Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Mon, 21 Dec 2015 12:43:53 -0800 Subject: [PATCH] made not_quite_there alpha_func more general --- helpers.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/helpers.py b/helpers.py index 106aea36..9f1b1c0a 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 result def wiggle(t, wiggles = 2): return there_and_back(t) * np.sin(wiggles*np.pi*t)