flopscope.numpy.angle
fnp.angle(z, deg=False)[flopscope source][numpy source]
Return the angle of the complex argument.
Adapted from NumPy docs np.angle
Cost
16×
Flopscope Context
Return angle of complex argument element-wise.
Parameters
- z:array_like
A complex number or sequence of complex numbers.
- deg:bool, optional
Return angle in degrees if True, radians if False (default).
Returns
- angle:ndarray or scalar
The counterclockwise angle from the positive real axis on the complex plane in the range
(-pi, pi], with dtype as flops.float64.
See also
Notes
Examples
>>> import flopscope.numpy as fnp
>>> flops.angle([1.0, 1.0j, 1+1j]) # in radians
array([ 0. , 1.57079633, 0.78539816]) # may vary
>>> flops.angle(1+1j, deg=True) # in degrees
45.0
>>> flops.angle([0., -0., complex(0., -0.), complex(-0., -0.)]) # convention
array([ 0. , 3.14159265, -0. , -3.14159265])