पायथन cmath.rect () विधि
उदाहरण
ध्रुवीय निर्देशांक को आयताकार रूप में बदलें:
#import cmath for complex number operations
import cmath
#convert
a polar coordinate to rectangular form
print(cmath.rect(3.1622776601683795, 1.2490457723982544))
परिभाषा और उपयोग
यह cmath.rect()
विधि ध्रुवीय निर्देशांकों को सम्मिश्र संख्या के आयताकार रूप में परिवर्तित करती है। यह चरण और मापांक के साथ एक सम्मिश्र संख्या बनाता है।
यह विधि समतुल्य है r * (math.cos(phi) +
math.sin(phi)*1j)
।
नोट: त्रिज्या r सदिश की लंबाई है, और phi (चरण कोण) वास्तविक अक्ष से बना कोण है।
वाक्य - विन्यास
cmath.rect(r, phi)
पैरामीटर मान
Parameter | Description |
---|---|
r | Required. Represents the modulus of a complex number |
phi | Required. Represents the phase of a complex number |
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | complex एक जटिल संख्या के आयताकार रूप का प्रतिनिधित्व करने वाला एक मान |
---|---|
पायथन संस्करण: | 2.6 |