title: Printing a Sine Wave to the Console
body: <p>I'm working on a Java program that prints a sine wave to the console. This is what I've written so far:</p>
  
  <pre><code>int num = 7;
  for (double y = 2; y &gt;= 0; y-=0.2) {
    for (double x = 0; x &lt;= num; x+=0.2) {
      if ( ((0.1+x) &gt;= Math.asin((double)y-1)) &amp;&amp; (((double)x-0.1) &lt;= Math.asin((double)y-1)) )
        System.out.print('*');
      else
        System.out.print(' ');
    }
    System.out.println();
  }
  </code></pre>
  
  <p>Essentially, this program treats each character on each line as a 0.2 x 0.2 area on a coordinate plane. If the sine function crosses this area, an asterisk is printed to the screen. Otherwise, a space is printed.
  When run, this is printed to the console:</p>
  
  <pre><code>        *                          
       *                             
     *                               
    *                                
   *                                 
  *                                  
  </code></pre>
  
  <p>Can anybody tell me why my program stops after printing the first quarter of the wave?</p>