Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. public class UnitCircle extends ConsoleProgram
  2. {
  3. public void run()
  4. {
  5. System.out.println("Radians: (cos, sin)");
  6. for (int i = 0; i < 8 ; i++)
  7. {
  8. double radians = (i * Math.PI)/4 ;
  9. System.out.println(roundTwo(radians) + ": " + roundTwo(Math.cos(radians)) + ", " + roundTwo(Math.sin(radians)));
  10. }
  11.  
  12.  
  13.  
  14. }
  15.  
  16. private double roundTwo(double x) {
  17. return Math.round(x * 100) / 100.0;
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement