c++ problem, maybe with types
<p>I have a little problem in my code. The variables don't want to change their values. Can you say why?
Here is my code:</p>

<pre><code>vector&lt;coordinate&gt; rocks(N);
double angle;
double x, y;
// other code
while (x &gt; 1.0 || x &lt; -1.0 || y &gt; 1.0 || y &lt; -1.0) {
    angle = rand() * 2.0 * M_PI;
    cout &lt;&lt; angle &lt;&lt; endl;
    cout &lt;&lt; rocks[i - 1].x &lt;&lt; endl;
    cout &lt;&lt; rocks[i - 1].y &lt;&lt; endl;
    x = rocks[i-1].x + r0 * cos(angle);
    y = rocks[i-1].y + r0 * sin(angle);
    cout &lt;&lt; x &lt;&lt; endl;
    cout &lt;&lt; y &lt;&lt; endl &lt;&lt; endl;
}
// other code
</code></pre>

<p>And the result on the console is:<br>
6.65627e+09<br>
0.99347<br>
0.984713<br>
1.09347<br>
0.984713  </p>

<p>1.16964e+09<br>
0.99347<br>
0.984713<br>
1.09347<br>
0.984713</p>

<p>As you see the values of x, y variables doesn't change and this while be an infinity loop. What's the problem? What do you think?</p>
