Mis a jour le 2025-04-14, 12:10

nombres complexes (module cmath)

Opérations sur les nombres complexes :
  • (1 + 1j) * (1 - 2j) donne (3-1j)
  • z = complex(1, 2); print(z); print(z.real); print(z.imag); : autre façon de définir un complexe et accès à sa partie réelle et imaginaire.
  • abs(z) : module de z.
  • c.conjugate() : le conjugué
  • cmath.phase(z) : argument de z (sa phase)
  • cmath.polar(z) : renvoie la paire (module, argument)
  • cmath.rect(mod, arg) : renvoie le nombre complexe ayant le module et l'argument indiqué.
  • cmath.exp, cmath.log, cmath.cos, cmath.sin, cmath.tan, cmath.acos, cmath.asin, cmath.atan : extensions complexes.
  • cmath.cosh, cmath.sinh, cmath.tanh, cmath.acosh, cmath.asinh, cmath.atanh : extensions complexes.

Copyright python-simple.com
programmer en python, tutoriel python, graphes en python, Aymeric Duclert