mirror of
https://github.com/3b1b/manim.git
synced 2025-07-31 05:52:34 +08:00
Merge branch 'master' of github.com:3b1b/manim
This commit is contained in:
@ -546,12 +546,16 @@ def wiggle(t, wiggles = 2):
|
||||
|
||||
def squish_rate_func(func, a = 0.4, b = 0.6):
|
||||
def result(t):
|
||||
if a == b:
|
||||
return a
|
||||
|
||||
if t < a:
|
||||
return func(0)
|
||||
elif t > b:
|
||||
return func(1)
|
||||
else:
|
||||
return func((t-a)/(b-a))
|
||||
|
||||
return result
|
||||
|
||||
# Stylistically, should this take parameters (with default values)?
|
||||
|
Reference in New Issue
Block a user