AutoHotkey | Android | Arduino | COMM140 | Fractals | Grammar Checkers | Knots | A Million Dots Activity | Processing | Processing for Scratch Users | Redbubble | Tutorials | Weather | World Time Meeting Planner | Favicon Generator.
Home > Tutorials > Processing > Processing Examples > Polar Flower v1
// draws a Polar Flower // Based on code from http://www.physics.emory.edu/~weeks/ideas/rose.html int screenWidth = 606; int screenHeight = 625; void setup() { size(screenWidth, screenHeight); background(#cccccc); // grey background strokeWeight(0.5); // thin lines smooth(); // antialias lines } float rad; float theta; float x; float y; float r; void draw() { for (rad = 1; rad < 45; rad ++) { for (theta = 0; theta <= 2.0 * PI; theta += 0.01) { r = rad * (8 + sin(theta * 6 + rad / 10)); x = r*cos(theta) + screenWidth / 2; y = r*sin(theta) + screenHeight / 2; ellipse(x,y,1,1); } } } // Save tif when mouse is clicked void mouseClicked(){ noLoop(); save("polar1_606.png"); }
APA citation:
Russell, R. (2016, July 05, 07:47 am). Polar Flower v1.
Retrieved December 22, 2024, from http://www.rupert.id.au/tutorials/processing/examples/Lissajous/lissajou_v37.php
Last refreshed: December 22 2024. 08:13.38 pm
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.