dpnp.angle
- dpnp.angle(x, deg=False)
Computes the phase angle (also called the argument) of each element x_i for input array x.
For full documentation refer to
numpy.angle
.- Parameters:
x ({dpnp.ndarray, usm_ndarray}) -- Input array, expected to have a complex-valued floating-point data type.
out ({None, dpnp.ndarray, usm_ndarray}, optional) -- Output array to populate. Array must have the correct shape and the expected data type.
order ({"C", "F", "A", "K"}, optional) -- Memory layout of the newly output array, if parameter out is
None
. Default:"K"
.
- Returns:
out -- An array containing the element-wise phase angles. The returned array has a floating-point data type determined by the Type Promotion Rules.
- Return type:
dpnp.ndarray
Notes
Although the angle of the complex number 0 is undefined, dpnp.angle(0) returns the value 0.
See also
dpnp.arctan2
Element-wise arc tangent of x1/x2 choosing the quadrant correctly.
dpnp.arctan
Trigonometric inverse tangent, element-wise.
dpnp.absolute
Calculate the absolute value element-wise.
Examples
>>> import dpnp as np >>> a = np.array([1.0, 1.0j, 1+1j]) >>> np.angle(a) # in radians array([0. , 1.57079633, 0.78539816]) # may vary
>>> np.angle(a, deg=True) # in degrees array([ 0., 90., 45.])