网站建设公司行情,许昌市住房和城乡建设局网站,asp网站图片轮播代码,专业网站设计 软件1 需求 课程中有大量的计算#xff0c;电路方程、复数计算#xff0c;之前都是用的MATLAB online#xff0c;可现在要过期了#xff0c;只能更换平台。
2 工具
https://www.online-python.com/
Python3 在线工具 | 菜鸟工具 (runoob.com)
3 Sinusoid 章节
涉及到复数计…1 需求 课程中有大量的计算电路方程、复数计算之前都是用的MATLAB online可现在要过期了只能更换平台。
2 工具
https://www.online-python.com/
Python3 在线工具 | 菜鸟工具 (runoob.com)
3 Sinusoid 章节
涉及到复数计算相关函数见 cmath --- 关于复数的数学函数 — Python 3.11.5 文档 3.1 复数 1 Code
import cmath,math
acomplex(6*math.cos(30/180*math.pi),6*math.sin(30/180*math.pi)) # transfer to randian
acmath.rect(6,30/180*math.pi)
bcomplex(5,-3)
ccomplex(2,4)
d(ab)/c
print(f the result is {d} )
print(f real {d.real}, img {d.imag})print(fin polar {abs(d)} {cmath.phase(d)/math.pi*180} ) Result: the result is (1.0196152422706632 -2.0392304845413265j) real 1.0196152422706632, img -2.0392304845413265 in polar 2.27992899261212 -63.43494882292201
3.2 复数2 Code
import cmath,mathacmath.rect(40,50/180*math.pi)
bcmath.rect(20,-30/180*math.pi)ccmath.sqrt(ab)
print(f a is {a} , b is {b}, sqrt (ab) is {c} or amplitude is {abs(c)} and with angle {cmath.phase(c)/math.pi*180}) Result a is (25.71150438746157430.64177772475912j) , b is (17.320508075688775-9.999999999999998j), sqrt (ab) is (6.73641982034078351.5321029771950059j) or amplitude is 6.908450732878534 and with angle 12.813149787630694 ** Process exited - Return Code: 0 ** Press Enter to exit terminal