Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Fixed `there_and_back_with_pause()` rate function behaviour with different `pause_ratio` values (#3778)

jkjkil40a2fbbeffb09
diff --git a/manim/utils/rate_functions.py b/manim/utils/rate_functions.py
index d3cd79c35..ab8cabc98 100644
--- a/manim/utils/rate_functions.py
+++ b/manim/utils/rate_functions.py
@@ -217,7 +217,7 @@ def there_and_back(t: float, inflection: float = 10.0) -> float:
@zero
def there_and_back_with_pause(t: float, pause_ratio: float = 1.0 / 3) -> float:
- a = 1.0 / pause_ratio
+ a = 2.0 / (1.0 - pause_ratio)
if t < 0.5 - pause_ratio / 2:
return smooth(a * t)
elif t < 0.5 + pause_ratio / 2: