Skip to content

Commit a805cc0

Browse files
authored
Make arctan2 work with ScalarQuantities
Ensures that x and y use the same unit, which is otherwise ignored (it is divided out).
1 parent 8e7e65a commit a805cc0

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/amuse/units/trigo.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
arcsin = lambda x: numpy.arcsin(x) | rad
1010
arccos = lambda x: numpy.arccos(x) | rad
1111
arctan = lambda x: numpy.arctan(x) | rad
12-
arctan2 = lambda x, y: numpy.arctan2(x, y) | rad
12+
arctan2 = lambda x, y: numpy.arctan2(
13+
x.value_in(x.unit),
14+
y.value_in(x.unit),
15+
) | rad
1316

1417

1518
def to_rad(angle):

0 commit comments

Comments
 (0)