numpy.angle()

numpy.angle

numpy.angle(z, deg=0) [source]

Return the angle of the complex argument.

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, with dtype as numpy.float64.

See also

arctan2, absolute

Examples

>>> np.angle([1.0, 1.0j, 1+1j])               # in radians
array([ 0.        ,  1.57079633,  0.78539816])
>>> np.angle(1+1j, deg=True)                  # in degrees
45.0

© 2008–2016 NumPy Developers
Licensed under the NumPy License.
https://docs.scipy.org/doc/numpy-1.11.0/reference/generated/numpy.angle.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部