Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat is '-1.#IND'?
    primarykey
    data
    text
    <p>I have some code that will allow me to draw a crescent moon shape, and have extracted the values to excel to be drawn. However in place of some numbers, there is <code>-1.#IND</code> in place. Firstly if anyone could explain what this means, as Google came back with 0 links. And secondly if there is anyway to stop it from occurring.</p> <p>There is a brief analogy of my code. I have lots more code besides this, however that is just calculating angles.</p> <pre><code>for(int j=0; j&lt;=n; j++)//calculation for angles and output displayed to user { Xnew2 = -j*(Y+R1)/n; //calculate x coordinate Ynew2 = Y*(pow(1-(pow((Xnew2/X),2)),0.5)); if(abs(Ynew2) &lt;= R1) cout&lt;&lt;"\n("&lt;&lt;Xnew2&lt;&lt;", "&lt;&lt;Ynew2&lt;&lt;")"&lt;&lt;endl; } </code></pre> <p>MORE INFO</p> <p>I'm now having the problem with this code. </p> <pre><code>for(int i=0; i&lt;=n; i++) //calculation for angles and output displayed to user { Xnew = -i*(Y+R1)/n; //calculate x coordinate Ynew = pow((((Y+R1)*(Y+R1)) - (Xnew*Xnew)), 0.5); //calculate y coordinate </code></pre> <p>AND </p> <pre><code>for(int j=0; j&lt;=n; j++)//calculation for angles and output displayed to user { Xnew2 = -j*(Y+R1)/((n)+((0.00001)*(n==0))); //calculate x coordinate Ynew2 = Y*(pow(abs(1-(pow((Xnew2/X),2))),0.5)); if(abs(Ynew2) &lt;= R1) cout&lt;&lt;"\n("&lt;&lt;Xnew2&lt;&lt;", "&lt;&lt;Ynew2&lt;&lt;")"&lt;&lt;endl; </code></pre> <p>I am having the problem drawing the crescent moon that I cannot get the two circles to have the same starting point? If this makes sense, I am trying to get two parts of circles to draw a crescent moon as such that they have the same start and end points. The only user input I have to work by is the radius and chosen center point. </p> <p>If anyone has any suggestions on how to do this, it would be great, currently all I am getting more a 'half doughnut' shape, due to the circles not being connected. </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.
 

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