Hướng dẫn how do you do complex exponentials in python? - làm thế nào để bạn thực hiện hàm mũ phức tạp trong python?

Giới thiệu về các số phức tạp Python: Số phức trong Python | Đặt 1 (Giới thiệu) Một số hàm và hằng số quan trọng hơn được thảo luận trong bài viết này. Các hoạt động trên các số phức tạp:
Some more important functions and constants are discussed in this article.
Operations on complex numbers :

1. exp ():- Hàm này trả về số mũ của số phức được đề cập trong đối số của nó. :- This function returns the exponent of the complex number mentioned in its argument.

2. Log (x, b):- Hàm này trả về giá trị logarit của x với cơ sở B, cả hai đều được đề cập trong các đối số của nó. Nếu cơ sở không được chỉ định, nhật ký tự nhiên của X được trả về. :- This function returns the logarithmic value of x with the base b, both mentioned in its arguments. If base is not specified, natural log of x is returned.

import cmath

import math

x =

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
0

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
1=
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
0

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
4=
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
6
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
7

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
8
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
9
Complex number is finite
Complex number is infinite
Complex number is NaN
0
Complex number is finite
Complex number is infinite
Complex number is NaN
1=
Complex number is finite
Complex number is infinite
Complex number is NaN
3

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
8
Complex number is finite
Complex number is infinite
Complex number is NaN
5

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
8
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
9
Complex number is finite
Complex number is infinite
Complex number is NaN
8
Complex number is finite
Complex number is infinite
Complex number is NaN
1=
Complex number is finite
Complex number is infinite
Complex number is NaN
3

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
8
The value of pi is : 3.141592653589793
The value of exponent is : 2.718281828459045
3
The value of pi is : 3.141592653589793
The value of exponent is : 2.718281828459045
4
The value of pi is : 3.141592653589793
The value of exponent is : 2.718281828459045
5

Output:

The exponent of complex number is : (1.4686939399158851+2.2873552871788423j)
The log(base 10) of complex number is : (0.15051499783199057+0.3410940884604603j)

3. log10 ():- Hàm này trả về cơ sở nhật ký 10 của một số phức. :- This function returns the log base 10 of a complex number.

4. Sqrt ():- Điều này tính toán căn bậc hai của một số phức.:- This computes the square root of a complex number.

import cmath

import math

x =

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
0

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
1=
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
0

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
4=
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
6
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
7

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
8
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
9
Complex number is finite
Complex number is infinite
Complex number is NaN
0
Complex number is finite
Complex number is infinite
Complex number is NaN
1=
Complex number is finite
Complex number is infinite
Complex number is NaN
3

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
8
Complex number is finite
Complex number is infinite
Complex number is NaN
5

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
8
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
9
Complex number is finite
Complex number is infinite
Complex number is NaN
8
Complex number is finite
Complex number is infinite
Complex number is NaN
1=
Complex number is finite
Complex number is infinite
Complex number is NaN
3

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
8
The value of pi is : 3.141592653589793
The value of exponent is : 2.718281828459045
3
The value of pi is : 3.141592653589793
The value of exponent is : 2.718281828459045
4
The value of pi is : 3.141592653589793
The value of exponent is : 2.718281828459045
5

Output:

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)

3. log10 ():- Hàm này trả về cơ sở nhật ký 10 của một số phức. :- Returns true if both real and imaginary part of complex number are finite, else returns false.

4. Sqrt ():- Điều này tính toán căn bậc hai của một số phức. :- Returns true if either real or imaginary part of complex number is/are infinite, else returns false.

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
8
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
9cmath2221=
Complex number is finite
Complex number is infinite
Complex number is NaN
3
:- Returns true if either real or imaginary part of complex number is NaN , else returns false.

import cmath

import math

x =

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
0

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
1=
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
0

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
4=
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
6
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
7

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
8
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
9
Complex number is finite
Complex number is infinite
Complex number is NaN
0
Complex number is finite
Complex number is infinite
Complex number is NaN
1=
Complex number is finite
Complex number is infinite
Complex number is NaN
3

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
8
Complex number is finite
Complex number is infinite
Complex number is NaN
5

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
8
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
9
Complex number is finite
Complex number is infinite
Complex number is NaN
8
Complex number is finite
Complex number is infinite
Complex number is NaN
1=
Complex number is finite
Complex number is infinite
Complex number is NaN
3

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
8
The value of pi is : 3.141592653589793
The value of exponent is : 2.718281828459045
3
The value of pi is : 3.141592653589793
The value of exponent is : 2.718281828459045
4
The value of pi is : 3.141592653589793
The value of exponent is : 2.718281828459045
5

3. log10 ():- Hàm này trả về cơ sở nhật ký 10 của một số phức.

4. Sqrt ():- Điều này tính toán căn bậc hai của một số phức.

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
8
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
9cmath2221=
Complex number is finite
Complex number is infinite
Complex number is NaN
3

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
8 cmath7

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
8
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
9import0
Complex number is finite
Complex number is infinite
Complex number is NaN
1=
Complex number is finite
Complex number is infinite
Complex number is NaN
3

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
8 import5

5. isfinite ():- Trả về đúng nếu cả phần thực và phần tưởng tượng của số phức là hữu hạn, nếu không trả về sai.

6. ISINF ():- Trả về đúng nếu phần thực hoặc phần tưởng tượng của số phức là/là vô hạn, nếu không trả về sai.

7. isnan ():- Trả về đúng nếu phần thực hoặc phần tưởng tượng của số phức là nan, nếu không trả về sai.

Output:

Complex number is finite
Complex number is infinite
Complex number is NaN

math6= math8

math9= x 1“pi”, which returns the numerical value of pi. The second one is “e” which returns the numerical value of exponent.

import cmath

import math

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
4=
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
6x 5

x 6=

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
6x 9

=0____9

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
6=3

=4 =5

Output:

The value of pi is : 3.141592653589793
The value of exponent is : 2.718281828459045

=6

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
8
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
9=9
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
00

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
01
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
02
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
8
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
9
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
05
The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
06
This article is contributed by Manjeet Singh. If you like GeeksforGeeks and would like to contribute, you can also write an article using write.geeksforgeeks.org or mail your article to . See your article appearing on the GeeksforGeeks main page and help other Geeks.

=4

The log10 of complex number is : (0.15051499783199057+0.3410940884604603j)
The square root of complex number is : (1.09868411346781+0.45508986056222733j)
08


Làm thế nào để bạn làm theo cấp số nhân trong Python?

Toán tử ** trong Python được sử dụng để tăng số ở bên trái lên sức mạnh của số mũ bên phải. Đó là, trong biểu thức 5 ** 3, 5 đang được nâng lên sức mạnh thứ 3.. That is, in the expression 5 ** 3 , 5 is being raised to the 3rd power.

Làm thế nào để bạn sử dụng chức năng phức tạp trong Python?

Để chuyển đổi một chuỗi hoặc một số thành một loại dữ liệu số phức trong Python, chúng ta có thể sử dụng một phương thức gọi là phức tạp () trong Python.Phương thức phức tạp () lấy hai tham số làm đầu vào: phần thực của số phức và phần tưởng tượng của số phức.Tham số đầu tiên là cần thiết.. The complex() method takes two parameters as input: the real part of the complex number and the imaginary part of the complex number. The first parameter is necessary.

Python có thể tính toán các số phức?

Các số phức tạp Vì phức tạp là một loại dữ liệu gốc trong Python, bạn có thể cắm các số phức tạp vào các biểu thức số học và gọi nhiều hàm tích hợp trong chúng.Các hàm nâng cao hơn cho các số phức được xác định trong mô -đun CMATH, là một phần của thư viện tiêu chuẩn.you can plug complex numbers into arithmetic expressions and call many of the built-in functions on them. More advanced functions for complex numbers are defined in the cmath module, which is part of the standard library.

Numpy có thể xử lý các số phức tạp không?

Numpy cung cấp phương thức vdot () trả về sản phẩm chấm của các vectơ a và b.Hàm này xử lý các số phức khác nhau so với DOT (A, B).Ví dụ 1: Python3.This function handles complex numbers differently than dot(a, b). Example 1: Python3.