Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class UnitCircle extends ConsoleProgram
- {
- public void run()
- {
- System.out.println("Radians: (cos, sin)");
- for (int i = 0; i < 8 ; i++)
- {
- double radians = (i * Math.PI)/4 ;
- System.out.println(roundTwo(radians) + ": " + roundTwo(Math.cos(radians)) + ", " + roundTwo(Math.sin(radians)));
- }
- }
- private double roundTwo(double x) {
- return Math.round(x * 100) / 100.0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement