Need an argument function. Sage has a built-in arg
for complex types, but let's roll our own here to show it can be done:
A little testing:
2.50000000000000
-0.588002603547568
-0.588002603547568
Now let's try to find the square root of a complex number:
Testing:
(13^(1/4)*cos(1/2*arctan(3/2)), 13^(1/4)*sin(1/2*arctan(3/2)))
1.67414922803554 + 0.895977476129838*I
2.00000000000000 + 3.00000000000000*I
This is peculiar and unexpected: Apparently, when you call n
on a 2-tuple, it returns a complex number. (Can't use on an ordered triple, etc.)
2.00000000000000 + 3.00000000000000*I
-3.00000000000000 + 2.00000000000000*I
Here's an inverse to z^2 + c:
-0.707106781186548 - 0.707106781186548*I
1.00000000000000 + 1.00000000000000*I