atan2#

rbc.stdlib.elementwise_functions.atan2(x1, x2)#

Calculates an implementation-dependent approximation of the inverse tangent of the quotient x1/x2, having domain [-infinity, +infinity] x [-infinity, +infinity] (where the x notation denotes the set of ordered pairs of elements (x1_i, x2_i)) and codomain [-π, +π], for each pair of elements (x1_i, x2_i) of the input arrays x1 and x2, respectively.

Examples

>>> from rbc.stdlib import array_api
>>> @heavydb('double[](int64[], int64[])')
... def array_api_atan2(x1, x2):
...     return array_api.atan2(x1, x2)
>>> x = np.array([-1, +1, +1, -1])
>>> y = np.array([-1, -1, +1, +1])
>>> array_api_atan2(x, y).execute() * 180 / np.pi
array([-135.,  135.,   45.,  -45.], dtype=float32)

Array-API ‘atan2’ doc