blosc2.arctan2#

blosc2.arctan2(ndarr1: NDArray | NDField | C2Array, ndarr2: NDArray | NDField | C2Array, /) LazyExpr#

Compute the element-wise arc tangent of ndarr1 / ndarr2 choosing the quadrant correctly.

Parameters:
Returns:

out – A lazy expression representing the element-wise arc tangent of ndarr1 / ndarr2. The result can be evaluated.

Return type:

LazyExpr

References

np.arctan2

Examples

>>> import numpy as np
>>> import blosc2
>>> y = np.array([0, 1, 0, -1, 1])
>>> x = np.array([1, 1, -1, -1, 0])
>>> ndarray_y = blosc2.asarray(y)
>>> ndarray_x = blosc2.asarray(x)
>>> result_lazy = blosc2.arctan2(ndarray_y, ndarray_x)
>>> result = result_lazy[:]
>>> print("y:", y)
y: [ 0  1  0 -1  1]
>>> print("x:", x)
x: [ 1  1 -1 -1  0]
>>> print("Arctan2(y, x):", result)
Arctan2(y, x): [ 0.          0.78539816  3.14159265 -2.35619449  1.57079633]