Array
Januar 28, 2007
int[] numbers = new int[3]; numbers[0] = 90; numbers[1] = 150; numbers[2] = 30; // Sets variable a to 240 int a = numbers[0] + numbers[1]; // Sets variable b to 180 int b = numbers[1] + numbers[2];
int[] numbers = { 90, 150, 30 };
// Sets variable a to 240
int a = numbers[0] + numbers[1];
// Sets variable b to 180
int b = numbers[1] + numbers[2];
int degrees = 360;
float[] cos_vals = new float[degrees];
for(int i=0; i < degrees; i++) {
cos_vals[i] = cos(TWO_PI/degrees * i);
}
Entry Filed under: Processing code. .
Trackback this post | Subscribe to the comments via RSS Feed