mirror of
https://github.com/3b1b/manim.git
synced 2025-08-01 08:54:38 +08:00
made not_quite_there alpha_func more general
This commit is contained in:
@ -257,8 +257,11 @@ def there_and_back(t, inflection = 10.0):
|
|||||||
new_t = 2*t if t < 0.5 else 2*(1 - t)
|
new_t = 2*t if t < 0.5 else 2*(1 - t)
|
||||||
return smooth(new_t, inflection)
|
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):
|
def wiggle(t, wiggles = 2):
|
||||||
return there_and_back(t) * np.sin(wiggles*np.pi*t)
|
return there_and_back(t) * np.sin(wiggles*np.pi*t)
|
||||||
|
Reference in New Issue
Block a user