Skip to content

Commit

Permalink
add clarification in angle_between docs
Browse files Browse the repository at this point in the history
  • Loading branch information
navidcy committed Sep 5, 2023
1 parent 00ad0b5 commit 2ee793d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion regional_mom6/regional_mom6.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,11 @@ def dz(npoints, ratio, target_depth, min_dz=0.0001, tolerance=1):


def angle_between(v1, v2, v3):
"""Returns angle v2-v1-v3 that is between the vectors v1-v2 and v1-v3."""
"""Returns the angle v2-v1-v3 (in radians). That is the angle between vectors v1-v2 and v1-v3."""

v1xv2 = np.cross(v1, v2)
v1xv3 = np.cross(v1, v3)

cosangle = np.dot(v1xv2, v1xv3) / np.sqrt(
np.dot(v1xv2, v1xv2) * np.dot(v1xv3, v1xv3)
)
Expand Down

0 comments on commit 2ee793d

Please sign in to comment.