Python 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()
နိတ်များကို ရှုပ်ထွေးကိန်းဂဏန်း၏ စတုဂံပုံစံသို့ ပြောင်းပေးသည်။ ၎င်းသည် phase နှင့် modulus ဖြင့် ရှုပ်ထွေးသော နံပါတ်တစ်ခုကို ဖန်တီးသည်။
ဤနည်းလမ်းသည် တူညီသည် r * (math.cos(phi) +
math.sin(phi)*1j)
။
မှတ်ချက်- အချင်းဝက် r သည် vector ၏အရှည်ဖြစ်ပြီး 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 ကိန်းဂဏန်းတစ်ခု၏ စတုဂံပုံစံကို ကိုယ်စားပြုသော တန်ဖိုး |
---|---|
Python ဗားရှင်း- | ၂.၆ |