mirror of
https://github.com/3b1b/manim.git
synced 2025-07-28 04:23:16 +08:00
Add poly_line_length function
This commit is contained in:
@ -61,6 +61,13 @@ def normalize(
|
||||
return np.zeros(len(vect))
|
||||
|
||||
|
||||
def poly_line_length(points):
|
||||
"""
|
||||
Return the sum of the lengths between adjacent points
|
||||
"""
|
||||
diffs = points[1:] - points[:-1]
|
||||
return np.sqrt((diffs**2).sum(1)).sum()
|
||||
|
||||
# Operations related to rotation
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user