Fun with sine and cosine

Nikolaus Gradwohl2008-10-24T06:22:00+00:00

I just played a bit with sine and cosine and got a very nice picture. the code takes some time to run, so i post a pregenerated image this time.

float r;
void setup() {
  size(600,600);
  smooth();
  r = max( width/2, height/2) * 0.8;
  noLoop();
}
void draw() {
  background(0);
  stroke( 255, 2 );
  strokeWeight(2);
  lines( 4 );
  filter( BLUR, 4 );
  stroke( 255, 6 );
  strokeWeight(1);
  lines( 2);
}

void lines( float factor ) {
  for ( int j = 0; j < 360 * 10 * factor; j++ ) {
    float i = j/factor;
    line( width/2 - r * cos( radians( i / 2.1 )), 
          height/2 - r * sin( radians( i  )),
          width/2 - r * sin( radians ( i / 1.01  )),
          height/2 - r * cos( radians( 180 - i ))
    );
  }
}
Tweet This! submit to reddit Digg! Tags: | 1 comments | no trackbacks

See also:

Processing Flowers for the livingroom
hexagonal abstract art generator
Little Picture frame turned into a Vampire
Framed Pictures made with the Abstract-Art-Generator
Abstract Art Generator 4

Trackbacks

Comments

Leave a response

  1. wizzarde 2008-10-26T07:56:40+00:00

    Jau, that is realy beautifull!

Leave a comment