bundles / numpy latest / numpy / ma / core / angle
_MaskedUnaryOperation
numpy.ma.core:angle
source: build-install/usr/lib/python3.14/site-packages/numpy/ma/core.py
Signature
def angle ( a , * args , ** kwargs ) Summary
Return the angle of the complex argument.
Parameters
z: array_likeA complex number or sequence of complex numbers.
deg: bool, optionalReturn angle in degrees if True, radians if False (default).
Returns
angle: ndarray or scalarThe counterclockwise angle from the positive real axis on the complex plane in the range
(-pi, pi], with dtype as numpy.float64.
Notes
This function passes the imaginary and real parts of the argument to arctan2 to compute the result; consequently, it follows the convention of arctan2 when the magnitude of the argument is zero. See example.
Examples
import numpy as np np.angle([1.0, 1.0j, 1+1j]) # in radians np.angle(1+1j, deg=True) # in degrees np.angle([0., -0., complex(0., -0.), complex(-0., -0.)]) # convention
See also
Aliases
-
numpy.ma.angle