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. .

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Kategorien

Archive

Links