Ask Your Question

complex rectangular to polar

asked 2013-10-26 00:25:45 -0500

anonymous user


I'm new to Sage. How do I convert a complex number like 2+3i into its polar form symbolically to get it in the form r.e^i.theta?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-10-26 02:43:37 -0500

tmonteil gravatar image

You can use abs() and arg() functions to compute modulus and argument of a symbolic complex number as follows:

sage: a = 2 + 3*I
sage: b = abs(a)*e^(I*(arg(a))) ; b
sage: bool(a == b)

In the other direction, you can use real_part() and imag_part()

sage: c = real_part(b) + I*imag_part(b) ; c
sqrt(13)*cos(real_part(arctan(3/2)))*e^(-imag_part(arctan(3/2))) + I*sqrt(13)*e^(-imag_part(arctan(3/2)))*sin(real_part(arctan(3/2)))
sage: c.simplify()
3*I + 2
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-10-26 00:25:45 -0500

Seen: 852 times

Last updated: Oct 26 '13