mirror of
https://github.com/3b1b/manim.git
synced 2025-08-02 19:46:21 +08:00
Make sure smooth returns values only between 0 and 1
This commit is contained in:
@ -10,7 +10,10 @@ def linear(t):
|
||||
|
||||
def smooth(t, inflection=10.0):
|
||||
error = sigmoid(-inflection / 2)
|
||||
return (sigmoid(inflection * (t - 0.5)) - error) / (1 - 2 * error)
|
||||
return np.clip(
|
||||
(sigmoid(inflection * (t - 0.5)) - error) / (1 - 2 * error),
|
||||
0, 1,
|
||||
)
|
||||
|
||||
|
||||
def rush_into(t):
|
||||
|
Reference in New Issue
Block a user