Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //*******************************************************************
- // Welcome to CompileJava!
- // If you experience any issues, please contact us ('More Info') -->
- //*******************************************************************
- import java.lang.Math; // headers MUST be above the first class
- // one class needs to have a main() method
- public class HelloWorld
- {
- // arguments are passed using the text field below this editor
- public static void main(String[] args)
- {
- int maxVal = 250;
- int count = 256;
- for(int i = 0; i < count; i++)
- {
- //int val = Math.sin(Math.toRadians(i * 360 / 2 / count)) * maxVal;
- int val = (int)(Math.sin(Math.toRadians(i * 360 / 2 / count)) * maxVal);
- //System.out.print(String.format("0x%02X", val) + ", ");
- System.out.print(val + ", ");
- if(i % 8 == 7)
- System.out.println("");
- }
- //System.out.println("t");
- }
- }
Add Comment
Please, Sign In to add comment