September 2010
M T W T F S S
« Jun «-»  
 12345
6789101112
13141516171819
20212223242526
27282930  

Leaving Chris World?

Why not bring back a souvenir?

Archives

Old Polar Bars

 
/**
 * I've been reminising  about my high school C++ class
 * and thinking about how much I hated the fact I missed
 * getting to present my program due to having to walk for
 * graduation. I really hate that fact. I'd rather have
 * gotten to demo it.
 *
 * So, I realized I hadn't written a polar graph like program
 * with this API. And I figured that was no good.
 * So here it is. An ode to that class in which I never
 * got to present my final program.
 *
 * 33 min
 * Chris B Stones
 * January 30, 2009
 */
 
 int   H,K;
 float w;         // angular
 float phi;       // shift
 float A,a;       // Amplitude function
 int   N;         // Total Steps
 float phi_delta; // how fast to rotate the thing
 float w_delta;   // how many petals?? 
 
 void setup() {
   size(600,600);
   smooth();
   frameRate(25);
   PFont em = loadFont("Copperplate.vlw");
   textFont(em, 15);
 
   H = width/2;
   K = height/2;
   N = 600;
   phi = 0.0f;
   w   = 0.0f;
 }
 
 void draw() {
   float x,y;
 
   background(#C1B28C); // tanish brown
 
   fill(#FFFFFF);
   text("Polar Graphing",10,15);
   text("by Chris Stones",10,30);
   text("Explore with the mouse.",10,45);
 
   fill(#C62E66); // Redish Polar graphs
 
   // Draw points
   for( int i = 0; i < N; i++ ) {
     // Polar Equation
     a = 275*sin(w_delta*i+phi); // y = A sin(theta)
 
     x = a*cos(i) + H; // convert polar to rect coordinates
     y = a*sin(i) + K;
     rect(x,y,5,5);    // plot points
   }
 
   w_delta = ((float)mouseX)/width;
   phi_delta = ((float)mouseY)/height;
   // rotation is done with shifting
   phi = phi + phi_delta;
   w = w + w_delta;
 }
 
9:18 pm

I'm 24.

Today marks the first day I sat down at
an actual bar. (You know, that long wooden
thing with the drinks?) I've been to bars a long
time ago but never sat down for any length of
time. 

I don't drink.

I ordered a soda.

(They had coke.)

I drake it anyway. 

For free.
(Apparently that's not a real drink)

Which is fine with me. 

I just wish it wasn't
coke. 

I must be the only guy whom can go to a bar
and get sick from one of the non alcoholic beverages.

I found the experience to be enjoyable... but only when

it's not crowded and only with people I know. 

.....
In other notes, throwing a boomerang around
draws a lot of attention. My favorite place to
practice is on the Redwood Bowl.

7 comments to Old Polar Bars

Leave a Reply

 

 

 

You can use these HTML tags

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

Security Code: