Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

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 ofnumpy.angle().

Parameters:
  • z (ArrayLike) – A complex number or an array of complex numbers.

  • deg (bool) – Boolean. IfTrue, returns the result in degrees else returnsin radians. Default isFalse.

Returns:

An array of counterclockwise angle of each element ofz, with the sameshape asz of dtype float.

Return type:

Array

Examples

Ifz is a number

>>>z1=2+3j>>>jnp.angle(z1)Array(0.98279375, dtype=float32, weak_type=True)

Ifz is 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]]

Ifdeg=True.

>>>withjnp.printoptions(precision=2,suppress=True):...print(jnp.angle(z2,deg=True))[[ 71.57 -68.2 ] [-36.87  33.69]]
Contents

[8]ページ先頭

©2009-2025 Movatter.jp