Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. public class UnitCircle
  2. {
  3. public static void main(String[] args)
  4. {
  5. System.out.println("Radians: (cos, sin)");
  6.  
  7. double angle = 0.0;
  8. double piDivideTwo = Math.PI/2.0;
  9. double pi = Math.PI;
  10.  
  11. System.out.println(angle + ": " + Math.cos(angle) + ", " + Math.sin(angle) );
  12.  
  13. double cosine = Math.cos(piDivideTwo);
  14. cosine = Math.round(cosine * 100) / 100.0;
  15.  
  16. System.out.println(piDivideTwo + ": " + cosine +", " + Math.sin(piDivideTwo) );
  17.  
  18. double sin = Math.sin(pi);
  19. sin = Math.round(sin *100) / 100.0;
  20.  
  21. System.out.println(pi + ": " + Math.cos(pi) + ", " + sin );
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement