Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This doesn't really make sense. The exponential form is simply an alternative way of expressing a complex number. For example</p> <pre><code> z = x + iy </code></pre> <p>is the standard real and imaginary component representation that you use in your first class. The exponential form is</p> <pre><code> z = r * exp(i * theta) </code></pre> <p>where <code>r</code> is the modulus and <code>theta</code> is the argument where</p> <pre><code> r = sqrt(x*x + y*y) </code></pre> <p>and </p> <pre><code> z = r*( cos(theta) + i*sin(theta)) </code></pre> <p>Essentially this is just converting the cartesian coordinates to the equivalent polar representation. </p> <p>You are storing a double in the second derived class called <code>exponential</code> which you are trying to calculate but really this value is meaningless. You are calculating the modulus as <code>module</code> correctly and the argument as <code>fi</code> but it appears you want <code>exponential</code> to be </p> <pre><code> module*exp(fi) </code></pre> <p>which is not really meaningful. If you want to store the values of modulus and argument that are correct for your values of <code>x</code> and <code>y</code> as cartesian real and imaginary components that would make more sense but storing just a double <code>exponential</code> is meaningless unless you have omitted something from the question.</p> <p>It seems that you would really be better off either just calculating the modulus and argument from your <code>re</code> and <code>im</code> variables and returning them from a function or storing them as additional member variables. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload