jax.numpy.angle
Contents
jax.numpy.angle#
- jax.numpy.angle(z,deg=False)[source]#
Return the angle of a complex valued number or array.
JAX implementation of
numpy.angle().- Parameters:
z (ArrayLike) – A complex number or an array of complex numbers.
deg (bool) – Boolean. If
True, returns the result in degrees else returnsin radians. Default isFalse.
- Returns:
An array of counterclockwise angle of each element of
z, with the sameshape aszof dtype float.- Return type:
Examples
If
zis a number>>>z1=2+3j>>>jnp.angle(z1)Array(0.98279375, dtype=float32, weak_type=True)
If
zis an array>>>z2=jnp.array([[1+3j,2-5j],...[4-3j,3+2j]])>>>withjnp.printoptions(precision=2,suppress=True):...print(jnp.angle(z2))[[ 1.25 -1.19] [-0.64 0.59]]
If
deg=True.>>>withjnp.printoptions(precision=2,suppress=True):...print(jnp.angle(z2,deg=True))[[ 71.57 -68.2 ] [-36.87 33.69]]
Contents
