mirror of
https://github.com/3b1b/manim.git
synced 2025-04-13 09:47:07 +00:00
Changed implementation of angle_between
This commit is contained in:
parent
7a5c419297
commit
a65dbf27d9
1 changed files with 2 additions and 3 deletions
|
@ -142,9 +142,8 @@ def angle_between_vectors(v1, v2):
|
|||
Returns the angle between two 3D vectors.
|
||||
This angle will always be btw 0 and TAU/2.
|
||||
"""
|
||||
l1 = get_norm(v1)
|
||||
l2 = get_norm(v2)
|
||||
return np.arccos(np.dot(v1, v2) / (l1 * l2))
|
||||
diff = (angle_of_vector(v1) - angle_of_vector(v2)) % TAU
|
||||
return min(diff, TAU - diff)
|
||||
|
||||
|
||||
def project_along_vector(point, vector):
|
||||
|
|
Loading…
Add table
Reference in a new issue