mars.tensor.angle

mars.tensor.angle(z, deg=False, **kwargs)[源代码]

Return the angle of the complex argument.

参数
  • z (array_like) – A complex number or sequence of complex numbers.

  • deg (bool, optional) – Return angle in degrees if True, radians if False (default).

返回

angle – The counterclockwise angle from the positive real axis on the complex plane, with dtype as numpy.float64.

返回类型

Tensor or scalar

参见

arctan2, absolute

实际案例

>>> import mars.tensor as mt
>>> mt.angle([1.0, 1.0j, 1+1j]).execute()               # in radians
array([ 0.        ,  1.57079633,  0.78539816])
>>> mt.angle(1+1j, deg=True).execute()                  # in degrees
45.0