title: java math calculation for coordinates of circle given radius of 1.00
body: <p>In one of my assignments, I am asked to write a program to calculate the (x, y) coordinates of points on a circle of radius 1.0. Display the output of y values for all x values ranging from 1.00 to negative 1.00 by increments of 0.1 and display the output neatly using <code>printf</code>, where all the x values are aligned vertically and to the right of all the x values, the y values are aligned vertically like:</p>
  
  <pre><code> x1    y1
  1.00  0.00
  0.90  0.44
  </code></pre>
  
  <p>I know how to calculate the y values by using the Pythagorean theorem, but I don't know how to display every x and y values neatly by using a loop and formatting it with <code>printf</code> Below is my code that I have so far, any help will be greatly appreciated:</p>
  
  <pre><code>public class PointsOnACircleV1 {
  
  /**
   * @param args the command line arguments
   */
  public static void main(String[] args) {
      // TODO code application logic here
  
      // // create menu
  
      // create title
      System.out.println("Points on a circle of Radius 1.0");
  
      // create x1 and y1
      System.out.println("          x1                         y1");
  
      // create line
      System.out.println("_________________________________________________");
  
      // // display x values
  
      // loop?
  
  
      // // perform calculation
  
      // radius
      double radius = 1.00;
  
      // x value
      double x = 1.00;
  
      // calculate y value
      double y = Math.pow(radius, 2) - Math.pow(x, 2);
  }
  
  }
  </code></pre>