Archive for the 'experiments' Category

Polar Coordinates, Sine, Cosine…

Monday, October 13th, 2008

One of my many favorite equations is the conversion from polar coordinates to cartesian... in actionscript it looks like this:

Actionscript:
  1. x = radius * Math.cos(theta);
  2. y = radius * Math.sin(theta);

I was teaching the ins and outs of polar coordinates to my students yesterday and thought of a good assignment for them... "Use Graphics or BitmapData to create an interactive sketch involving the polar to cartesian conversion." Now, when I first encounted this equation, I didn't really know what it was or why it worked... I used it for circular motion in Director... I also tried randomly tweaking it to see what kind of results I could get.... things like this:

Actionscript:
  1. // sort of like a figure 8
  2. x = radius * Math.cos(theta);
  3. y = radius * Math.sin(theta/2);
  4.  
  5. // an oval
  6. x = radius/2 * Math.cos(theta);
  7. y = radius * Math.sin(theta);
  8.  
  9. // etc...
  10. x = radius * Math.cos(theta);
  11. y = radius * Math.sin(theta) + radius * Math.cos(theta * 2);

I advocate this kind of random experimentation when I teach game design or talk to students interested in generative visuals. Playing with the numbers just improves understanding... even if you don't know what your playing with at first...

When I got home yesterday I created this small sketch:


To see the flash version continue reading this post....

Read the rest of this entry »

Ink Cam

Saturday, October 11th, 2008

This is another variation on the sketch from my previous post (avalanche cam).

You'll need a web cam of some kind if you want to see the flash version:


Click any of the above images to view the flash version

Avalanche Cam

Wednesday, October 8th, 2008

A few posts back I posted a programmatic sketch that resembles an abstract avalanche. Today I applied the same technique to my webcam and here is the result... you can click any of the below images to view the flash, but you'll need a webcam ... isight etc....



Click any of the above images to view the flash version

It looks very odd when it's not in black and white, maybe I'll post a color version in the near future....