Life as Clay

Tangent to a busy day

leave a comment »

Today was busy. I didn’t crack open the book today, but instead, just tried to create something interesting based on what I remembered, and playing with sine, cosine, and tangent. I found, interestingly, that if I tried to move the center point of an ellipse using random(-10,10) for both the x and y coordinates, that it ultimately would move toward the origin. That movement produced these:


aquaI like the last one… primarily for the color. :)

I changed to color variation and a line drawn using a random number based on the tangent of the center of the circle (for each iteration). It resulted in this:

staticErgly, as my high school Chinese teacher used to say, but interesting in that it tended towards the origin again. What’s up with the random() function that it tends towards the origin? Here the code for the last picture:

int z;
int x = 200;
int y = 200;

void setup() {

void draw() {
  z = int(random(200));
  x += random(-1,2);
  y += random(-1,2);

It ain’t gonna win me no prizes, but at least I’m learning.



Written by Clay

October 30, 2009 at 02:36

Posted in Code, Processing

Tagged with , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: