Skip to content

Commit 124ed9d

Browse files
authored
fix: prevent vector position array from being modified (ManimCommunity#3273) (ManimCommunity#3282)
changed from np.asarray(point) to nd.array(point) in order to make sure that a copy of the array is created even if func is the identity function lambda pos: pos Co-authored-by: Uwe Zimmermann <C:\Users\uwezi\AppData\Roaming\The Bat! Pwd>
1 parent a3b1d9f commit 124ed9d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

manim/mobject/vector_field.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ def get_vector(self, point: np.ndarray):
613613
The root point of the vector.
614614
615615
"""
616-
output = np.asarray(self.func(point))
616+
output = np.array(self.func(point))
617617
norm = np.linalg.norm(output)
618618
if norm != 0:
619619
output *= self.length_func(norm) / norm

0 commit comments

Comments
 (0)