Không chỉ số thực, Python còn có thể xử lý số phức và các hàm liên quan bằng tệp “cmath”. Số phức được sử dụng trong nhiều ứng dụng liên quan đến toán học và python cung cấp các công cụ hữu ích để xử lý và thao tác với chúng
Chuyển số thực thành số phức
Một số phức được đại diện bởi “ x + yi “. Python chuyển đổi các số thực x và y thành số phức bằng cách sử dụng hàm complex[x,y]. Phần thực có thể được truy cập bằng hàm real[] và phần ảo có thể được biểu diễn bằng hàm imag[]
The phase of complex number is : 3.1415926535897936
The phase of complex number is : 3.1415926535897937
The phase of complex number is : 3.1415926535897938
The phase of complex number is : 3.1415926535897939
The phase of complex number is : 3.1415926535897930
The phase of complex number is : 3.1415926535897931
The phase of complex number is : 3.1415926535897938
The phase of complex number is : 3.1415926535897930
The phase of complex number is : 3.1415926535897931
The phase of complex number is : 3.1415926535897932
The phase of complex number is : 3.1415926535897933
The phase of complex number is : 3.1415926535897934
The phase of complex number is : 3.1415926535897932
The phase of complex number is : 3.1415926535897936
The phase of complex number is : 3.1415926535897938
The phase of complex number is : 3.1415926535897938
The phase of complex number is : 3.1415926535897939
The phase of complex number is : 3.1415926535897932
The phase of complex number is : 3.14159265358979301
The phase of complex number is : 3.14159265358979302
The phase of complex number is : 3.1415926535897938
The phase of complex number is : 3.14159265358979304
The phase of complex number is : 3.14159265358979305
The phase of complex number is : 3.14159265358979306
The phase of complex number is : 3.14159265358979307
The phase of complex number is : 3.14159265358979308
The phase of complex number is : 3.1415926535897932
The phase of complex number is : 3.14159265358979360
The phase of complex number is : 3.14159265358979305
The phase of complex number is : 3.14159265358979362
The phase of complex number is : 3.1415926535897938
The phase of complex number is : 3.14159265358979305
The phase of complex number is : 3.14159265358979306
The phase of complex number is : 3.14159265358979366
The phase of complex number is : 3.14159265358979308
The phase of complex number is : 3.1415926535897932
The phase of complex number is : 3.14159265358979360
The phase of complex number is : 3.14159265358979305
The phase of complex number is : 3.14159265358979371
đầu ra
The phase of complex number is : 3.1415926535897934
Pha của số phức
Về mặt hình học, pha của số phức là góc giữa trục thực dương và vectơ biểu diễn số phức. Đây còn được gọi là đối số của số phức. Pha được trả về bằng phase[], lấy số phức làm đối số. Phạm vi của pha nằm từ -pi đến +pi. tôi. e từ -3. 14 đến +3. 14
The phase of complex number is : 3.1415926535897936
The phase of complex number is : 3.14159265358979373
The phase of complex number is : 3.1415926535897938
The phase of complex number is : 3.1415926535897939
The phase of complex number is : 3.1415926535897930
The phase of complex number is : 3.1415926535897931
The phase of complex number is : 3.1415926535897938
The phase of complex number is : 3.1415926535897930
The phase of complex number is : 3.1415926535897931
The phase of complex number is : 3.1415926535897932
The phase of complex number is : 3.14159265358979382
The phase of complex number is : 3.14159265358979383
The phase of complex number is : 3.1415926535897934
The phase of complex number is : 3.1415926535897932
The phase of complex number is : 3.14159265358979386
The phase of complex number is : 3.1415926535897938
The phase of complex number is : 3.1415926535897938
The phase of complex number is : 3.1415926535897939
The phase of complex number is : 3.1415926535897932
The phase of complex number is : 3.14159265358979301
The phase of complex number is : 3.14159265358979302
The phase of complex number is : 3.1415926535897938
The phase of complex number is : 3.14159265358979394
The phase of complex number is : 3.14159265358979305
The phase of complex number is : 3.14159265358979306
The phase of complex number is : 3.14159265358979397
The phase of complex number is : 3.14159265358979308
The phase of complex number is : 3.1415926535897932
The phase of complex number is : 3.14159265358979360
The phase of complex number is : 3.14159265358979305
The phase of complex number is : 3.14159265358979302
đầu ra
The phase of complex number is : 3.141592653589793
Chuyển từ dạng cực sang dạng chữ nhật và ngược lại
Chuyển đổi sang cực được thực hiện bằng cách sử dụng cực[], trả về một cặp[r,ph] biểu thị mô đun r và góc pha ph. mô-đun có thể được hiển thị bằng cách sử dụng abs[] và pha sử dụng phase[].
Số phức chuyển đổi thành tọa độ hình chữ nhật bằng cách sử dụng rect[r, ph], trong đó r là mô đun và ph là góc pha. Nó trả về một giá trị số bằng r * [math. cos[ph] + toán học. sin[ph]*1j]
The phase of complex number is : 3.1415926535897936
The phase of complex number is : 3.14159265358979304
The phase of complex number is : 3.1415926535897938
The phase of complex number is : 3.1415926535897939
The phase of complex number is : 3.1415926535897930
The phase of complex number is : 3.1415926535897931
The phase of complex number is : 3.1415926535897930
The phase of complex number is : 3.14159265358979310
The phase of complex number is : 3.1415926535897938
The phase of complex number is : 3.1415926535897930
The phase of complex number is : 3.1415926535897931
The phase of complex number is : 3.1415926535897932
The phase of complex number is : 3.14159265358979383
The phase of complex number is : 3.1415926535897934
The phase of complex number is : 3.1415926535897932
The phase of complex number is : 3.14159265358979383
The phase of complex number is : 3.1415926535897938
The phase of complex number is : 3.1415926535897938
The phase of complex number is : 3.1415926535897939
The phase of complex number is : 3.1415926535897932
The phase of complex number is : 3.14159265358979301
The phase of complex number is : 3.14159265358979302
The phase of complex number is : 3.1415926535897938
The phase of complex number is : 3.14159265358979386
The phase of complex number is : 3.14159265358979387
The phase of complex number is : 3.1415926535897932
The phase of complex number is : 3.14159265358979389
The phase of complex number is : 3.1415926535897938
The phase of complex number is : 3.14159265358979301
The phase of complex number is : 3.14159265358979305
The phase of complex number is : 3.14159265358979306
The phase of complex number is : 3.14159265358979304
The phase of complex number is : 3.14159265358979308
The phase of complex number is : 3.1415926535897932
The phase of complex number is : 3.14159265358979360
The phase of complex number is : 3.14159265358979305
The phase of complex number is : 3.14159265358979309
The phase of complex number is : 3.1415926535897938
The phase of complex number is : 3.14159265358979311
The phase of complex number is : 3.14159265358979387
The phase of complex number is : 3.1415926535897932
The phase of complex number is : 3.14159265358979314
The phase of complex number is : 3.14159265358979315
The phase of complex number is : 3.14159265358979316
The phase of complex number is : 3.14159265358979317
The phase of complex number is : 3.14159265358979318
The phase of complex number is : 3.1415926535897938
The phase of complex number is : 3.14159265358979320
The phase of complex number is : 3.14159265358979305
The phase of complex number is : 3.14159265358979306
The phase of complex number is : 3.14159265358979323
The phase of complex number is : 3.14159265358979308
The phase of complex number is : 3.1415926535897932
The phase of complex number is : 3.14159265358979360
The phase of complex number is : 3.14159265358979305
The phase of complex number is : 3.14159265358979309
đầu ra
The phase of complex number is : 3.1415926535897930
Số phức trong Python. Tập 2 [Hàm và hằng số quan trọng]
Bài viết này được đóng góp bởi Manjeet Singh. Nếu bạn thích GeeksforGeeks và muốn đóng góp, bạn cũng có thể viết một bài báo bằng cách sử dụng đóng góp. chuyên viên máy tính. org hoặc gửi bài viết của bạn tới donate@geeksforgeeks. tổ chức. Xem bài viết của bạn xuất hiện trên trang chính của GeeksforGeeks và trợ giúp các Geeks khác
Vui lòng viết bình luận nếu bạn thấy bất cứ điều gì không chính xác hoặc bạn muốn chia sẻ thêm thông tin về chủ đề thảo luận ở trên