(x, y) coordinates of points on a circle of radius 1.0. I need help finding x2 and y2
<p>My assessment was to do the program and the instructions are listed below.</p>

<blockquote>
  <ol>
  <li>The radius of the circle should be 1.0.</li>
  <li>Use the appropriate Math class methods in your arithmetic expression(s).</li>
  <li>The value of the x coordinate should change by 0.1 during initial testing. After the program is working verify that the increment can
  also be 0.01, or 0.001 with only minor changes to the code.</li>
  <li>Display the information in a neatly formatted table. (See expected output.) Use a Formatting Grid to save time developing the layout for
  your output. Background: Recall from your algebra class that the
  Pythagorean Theorem can be used to determine the x or y coordinate if
  you know the radius of the circle and the value of either x or y.
  Assume that you are dealing with a circle whose radius is 1. If you
  iterate through successive values of x, then you can calculate the
  corresponding value of y. Be sure to use methods of the Math class to
  set up the arithmetic expression.</li>
  </ol>
</blockquote>

<p>This is the circle: <a href="http://i.stack.imgur.com/NypKz.png" rel="nofollow">http://i.stack.imgur.com/NypKz.png</a></p>

<p>I did the program below.</p>

<pre><code>public class PointsOnACircleV1 {
    public static void main(String[ ] args)
    {
   double[] x1 = { 1.0, 0.90, 0.80, 0.70, 0.60, 0.50, 0.40, 0.30, 0.20,
           0.10, 0.00, -0.10, -0.20, -0.30, -0.40, -0.50, -0.60, -0.70,
           -0.80, -0.90, -1.00 };

double r = 1;

    System.out.println("      Points on a Circle of Radius 1.0");
    System.out.println("       x1        y1        x2        y2");
    System.out.println("---------------------------------------------");

for (int i = 0; i &lt; x1.length; i++) {
    double y1 = Math.sqrt(Math.pow(r, 2) - Math.pow(x1[i], 2));
    double y2 = Math.sqrt(Math.pow(r, 2) - Math.pow(x1[i], 2));
    System.out.printf("%10.2f%10.2f%10.2f%10.2f%n", x1[i], y1, x1[i], y2);
}
    System.out.println("");
}
}
</code></pre>

<p>The output is supposed to be like this: <a href="http://i.stack.imgur.com/pywwJ.png" rel="nofollow">http://i.stack.imgur.com/pywwJ.png</a></p>

<p>I am getting a different output. My output is coming like this.</p>

<pre><code>      Points on a Circle of Radius 1.0
       x1        y1        x2        y2
---------------------------------------------
      1.00      0.00      1.00      0.00
      0.90      0.44      0.90      0.44
      0.80      0.60      0.80      0.60
      0.70      0.71      0.70      0.71
      0.60      0.80      0.60      0.80
      0.50      0.87      0.50      0.87
      0.40      0.92      0.40      0.92
      0.30      0.95      0.30      0.95
      0.20      0.98      0.20      0.98
      0.10      0.99      0.10      0.99
      0.00      1.00      0.00      1.00
     -0.10      0.99     -0.10      0.99
     -0.20      0.98     -0.20      0.98
     -0.30      0.95     -0.30      0.95
     -0.40      0.92     -0.40      0.92
     -0.50      0.87     -0.50      0.87
     -0.60      0.80     -0.60      0.80
     -0.70      0.71     -0.70      0.71
     -0.80      0.60     -0.80      0.60
     -0.90      0.44     -0.90      0.44
     -1.00      0.00     -1.00      0.00
</code></pre>
