mirror of
https://github.com/3b1b/manim.git
synced 2025-07-30 13:34:19 +08:00
Improved there_and_back_with_pause
This commit is contained in:
@ -33,13 +33,14 @@ def there_and_back(t, inflection=10.0):
|
|||||||
return smooth(new_t, inflection)
|
return smooth(new_t, inflection)
|
||||||
|
|
||||||
|
|
||||||
def there_and_back_with_pause(t):
|
def there_and_back_with_pause(t, pause_ratio=1. / 3):
|
||||||
if t < 1. / 3:
|
a = 1. / pause_ratio
|
||||||
return smooth(3 * t)
|
if t < 0.5 - pause_ratio / 2:
|
||||||
elif t < 2. / 3:
|
return smooth(a * t)
|
||||||
|
elif t < 0.5 + pause_ratio / 2:
|
||||||
return 1
|
return 1
|
||||||
else:
|
else:
|
||||||
return smooth(3 - 3 * t)
|
return smooth(a - a * t)
|
||||||
|
|
||||||
|
|
||||||
def running_start(t, pull_factor=-0.5):
|
def running_start(t, pull_factor=-0.5):
|
||||||
|
Reference in New Issue
Block a user