mirror of
https://github.com/3b1b/manim.git
synced 2025-08-02 02:35:22 +08:00
Remove clamp function, redundant with np.clip
This commit is contained in:
@ -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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user