bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / _external / array_api_extra / _lib / _funcs / angle
function
scipy._external.array_api_extra._lib._funcs:angle
source: build-install/usr/lib/python3.14/site-packages/scipy/_external/array_api_extra/_lib/_funcs.py:750
Signature
def angle(z: Array, /, deg: bool = False, xp: ArrayNamespace | None = None) → ArraySummary
Return the angle of the complex argument.
Parameters
z: ArrayInput array.
deg: bool, optionalReturn angle in degrees if True, radians if False (default).
xp: array_namespace, optionalThe standard-compatible namespace for
z. Default: infer.
Returns
: arrayThe counterclockwise angle from the positive real axis on the complex plane in the range
(-pi, pi].
Notes
Real input x is interpreted as x + 0j.
Examples
import array_api_strict as xp import array_api_extra as xpx xpx.angle(xp.asarray([1.0, 1.0j, 1 + 1j]), xp=xp) xpx.angle(xp.asarray([1.0, 1.0j, 1 + 1j]), deg=True, xp=xp)⚠
Traceback (most recent call last):
File "<doctest scipy._external.array_api_extra._lib._funcs:angle[0]>", line 1, in <module>
xpx.angle(xp.asarray([1.0, 1.0j, 1 + 1j]), deg=True, xp=xp)
^^^
NameError: name 'xpx' is not defined
Aliases
scipy.differentiate.xpx.angle