Skip to content

Instantly share code, notes, and snippets.

@7marcus9
Last active March 11, 2018 04:00
Show Gist options
  • Save 7marcus9/89c3490e1841a6ceb3511fc5fc5fcede to your computer and use it in GitHub Desktop.
Save 7marcus9/89c3490e1841a6ceb3511fc5fc5fcede to your computer and use it in GitHub Desktop.
//*******************************************************************
// 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");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment