mirror of
https://github.com/3b1b/manim.git
synced 2025-09-19 04:41:56 +00:00
Make sure smooth returns values only between 0 and 1
This commit is contained in:
parent
2f6fc82ecb
commit
67ae6bf3a8
1 changed files with 4 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Reference in a new issue