Return the angle of a complex valued number or array.
JAX implementation of numpy.angle()
.
z (ArrayLike) – A complex number or an array of complex numbers.
deg (bool) – Boolean. If True
, returns the result in degrees else returns in radians. Default is False
.
An array of counterclockwise angle of each element of z
, with the same shape as z
of dtype float.
Examples
If z
is a number
>>> z1 = 2+3j >>> jnp.angle(z1) Array(0.98279375, dtype=float32, weak_type=True)
If z
is an array
>>> z2 = jnp.array([[1+3j, 2-5j], ... [4-3j, 3+2j]]) >>> with jnp.printoptions(precision=2, suppress=True): ... print(jnp.angle(z2)) [[ 1.25 -1.19] [-0.64 0.59]]
If deg=True
.
>>> with jnp.printoptions(precision=2, suppress=True): ... print(jnp.angle(z2, deg=True)) [[ 71.57 -68.2 ] [-36.87 33.69]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4