mirror of
https://github.com/3b1b/manim.git
synced 2025-09-19 04:41:56 +00:00
Remove clamp function, redundant with np.clip
This commit is contained in:
parent
978e7c1799
commit
47ea8082d1
2 changed files with 1 additions and 8 deletions
|
@ -424,7 +424,7 @@ def make_alpha_winder(func, start, end, num_checkpoints, cheap = False):
|
|||
if cheap:
|
||||
return alpha # A test to see if this func is responsible for slowdown
|
||||
|
||||
index = clamp(0, num_checkpoints - 1, int(alpha * num_checkpoints))
|
||||
index = np.clip(0, num_checkpoints - 1, int(alpha * num_checkpoints))
|
||||
x = interpolate(start, end, alpha)
|
||||
if cheap:
|
||||
return check_points[index] # A more principled test that at least returns a reasonable answer
|
||||
|
|
|
@ -55,13 +55,6 @@ def match_interpolate(new_start, new_end, old_start, old_end, old_value):
|
|||
)
|
||||
|
||||
|
||||
def clamp(lower, upper, val):
|
||||
if val < lower:
|
||||
return lower
|
||||
elif val > upper:
|
||||
return upper
|
||||
return val
|
||||
|
||||
# Figuring out which bezier curves most smoothly connect a sequence of points
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue