How to convert from rectangular to polar form using C# Complex
<p>Trying to convert a number from rectangular to polar form, ie from 20+j25 to 32&lt;38.66</p>

<p>here's what i have so far:</p>

<pre><code>    static void Main(string[] args)
    {
        Complex A = new Complex (0.4, 0.3);
        Complex B = new Complex (0.6, 0.7);
        Complex C = new Complex (24, 19);
        Complex D = A + B + C;

        Console.WriteLine (D);

        Console.ReadLine();
    }
</code></pre>

<p>That gives me the answer 20, 25. which is in rectangular form. how would i go about making this polar?</p>

<p>Thanks</p>

<p>EDIT:
Ok i've made a few changes but still can't get the right answer. Using the code:</p>

<pre><code>    static void Main(string[] args)
    {
        Complex RA = new Complex(25, 20);
        Console.WriteLine("{0} + i{1}", RA.Real, RA.Imaginary);

        double r, q;
        r = Math.Sqrt((RA.Real * RA.Real) + (RA.Imaginary * RA.Imaginary));
        q = Math.Atan(RA.Imaginary/RA.Real);
        Console.WriteLine("{0} &lt; {1}", r, q);
        Console.ReadLine();
    }
</code></pre>

<p>I'm getting 32 &lt; 0.647... the answer should be 32&lt;38.66. Can anyone explain why i'm getting the wrong angle?
Thanks</p>
