dpnp.arctan2
- dpnp.arctan2(x1, x2, /, out=None, *, where=True, order='K', dtype=None, subok=True, **kwargs)[source]
Element-wise arc tangent of x1/x2 choosing the quadrant correctly.
For full documentation refer to
numpy.arctan2.- Returns:
out – The inverse tangent of x1/x2, element-wise.
- Return type:
dpnp.ndarray
Limitations
Parameters x1 and x2 are supported as either scalar,
dpnp.ndarrayordpctl.tensor.usm_ndarray, but both x1 and x2 can not be scalars at the same time. Parameters where, dtype and subok are supported with their default values. Keyword arguments kwargs are currently unsupported. Otherwise the function will be executed sequentially on CPU. Input array data types are limited by real-valued data types.See also
dpnp.arctanTrigonometric inverse tangent, element-wise.
dpnp.tanCompute tangent element-wise.
dpnp.angleReturn the angle of the complex argument.
dpnp.arcsinTrigonometric inverse sine, element-wise.
dpnp.arccosTrigonometric inverse cosine, element-wise.
dpnp.arctanhInverse hyperbolic tangent, element-wise.
Examples
>>> import dpnp as np >>> x1 = np.array([1., -1.]) >>> x2 = np.array([0., 0.]) >>> np.arctan2(x1, x2) array([1.57079633, -1.57079633])
>>> x1 = np.array([0., 0., np.inf]) >>> x2 = np.array([+0., -0., np.inf]) >>> np.arctan2(x1, x2) array([0.0 , 3.14159265, 0.78539816])
>>> x1 = np.array([-1, +1, +1, -1]) >>> x2 = np.array([-1, -1, +1, +1]) >>> np.arctan2(x1, x2) * 180 / np.pi array([-135., -45., 45., 135.])