We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › drawing a spiral
Page Index Toggle Pages: 1
drawing a spiral (Read 1258 times)
drawing a spiral
Oct 9th, 2008, 10:04pm
 
hi there

i'm not really familiar with processing, but i really need a simple code that would draw a spiral from the middle of the document and completely fill the canvas. the line needs to be 2 or 3 pixels wide, and the space between lines should be the same... the document itself could be around 800x800 pixels.

just a simple patch i need for some artwork! i know this is extremely simple for veterans - so please help!

thanks!
.
Re: drawing a spiral
Reply #1 - Oct 9th, 2008, 10:53pm
 
Code:
size(800,800);
smooth();
translate(width/2,height/2);
strokeWeight(2);
beginShape();
for(int i=0;i<350;i++)
{
curveVertex((i*2)*sin(i/5.0),(i*2)*cos(i/5.0));
}
endShape();
Page Index Toggle Pages: 1