1
invite 2014-12-29 11:50:08 +08:00
matlab 吧。
|
2
ChanneW 2014-12-29 11:55:32 +08:00
```
a = 1+3j b = a ** (0.5) ``` |
3
ruoyu0088 2014-12-29 12:04:29 +08:00 1
复数开平方就是模开平方,相角除以2,下面是演示代码:
import math a = 1.0 b = 2.0 r = math.sqrt(math.hypot(a, b)) theta = math.atan2(b, a) * 0.5 print r * math.cos(theta), r * math.sin(theta) sqrt, hypot, atan2, cos, sin都是C语言的标准库中间的函数。 |
4
IamI 2014-12-29 13:03:02 +08:00
Complex a + bi
a = rcosx b = rsinx (rcosx + irsinx)^n = r^n(cosnx+isinnx) n = 1/2 |
5
IamI 2014-12-29 13:07:18 +08:00
n = p/q, 若q > 1
x = x + 2k * pi, k = 0, 1, ... q - 1 |
7
est 2014-12-29 13:17:14 +08:00
python
>>> (6.0+3.0j)**(1.0/3.0) (1.863493910707937+0.29031663618281145j) |
8
shmilyin 2014-12-29 18:10:34 +08:00 1
|