Guest User

Untitled

a guest
Mar 19th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. //*******************************************************************
  2. // Welcome to CompileJava!
  3. // If you experience any issues, please contact us ('More Info') -->
  4. //*******************************************************************
  5.  
  6. import java.lang.Math; // headers MUST be above the first class
  7.  
  8. // one class needs to have a main() method
  9. public class HelloWorld
  10. {
  11. // arguments are passed using the text field below this editor
  12. public static void main(String[] args)
  13. {
  14. int maxVal = 250;
  15. int count = 256;
  16. for(int i = 0; i < count; i++)
  17. {
  18. //int val = Math.sin(Math.toRadians(i * 360 / 2 / count)) * maxVal;
  19. int val = (int)(Math.sin(Math.toRadians(i * 360 / 2 / count)) * maxVal);
  20. //System.out.print(String.format("0x%02X", val) + ", ");
  21. System.out.print(val + ", ");
  22. if(i % 8 == 7)
  23. System.out.println("");
  24. }
  25.  
  26. //System.out.println("t");
  27. }
  28. }
Add Comment
Please, Sign In to add comment