nlcpy.angle

nlcpy.angle(z, deg=False)

Returns the angle of the complex argument.

Parameters:
zarray_like

A complex number or sequence of complex numbers.

degbool, optional

Returns angle in degrees if True, radians if False (default).

Returns:
anglendarray

The counterclockwise angle from the positive real axis on the complex plane in the range (-pi, pi], with dtype as nlcpy.float64. If z is a scalar, this function returns the result as a 0-dimention array.

参考

arctan2

Computes an element-wise inverse tangent of x1/x2.

absolute

Computes an element-wise absolute value.

Examples

>>> import nlcpy as vp
>>> vp.angle([1.0, 1.0j, 1+1j])               # in radians
array([0.        , 1.57079633, 0.78539816])
>>> vp.angle(1+1j, deg=True)                  # in degrees
array(45.)