/**
* 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.
This does not work for windows and Explorer 6 or other things.
Cool. I like slowly moving tunnel when I put my mouse on the top, right corner.
Works on IE 6 if you have java installed.
This is very nice…so much variation. Interesting. Thanks for sharing.
Ah, and it did finally come up on my WindowsXP x64 and Firefox 3.0.5. I thought it wasn’t going to cause it didn’t show the loading thing.
VERY VERY COOL! : )
Wicked geezer! Amazing such simple code can bring about such complex interactive visual - well done