Created
October 18, 2014 21:10
-
-
Save futurefabric/7045c962c0713b6f3f94 to your computer and use it in GitHub Desktop.
Plot points in a circle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PLOT POINTS IN A CIRCLE | |
// By Guy Moorhouse @Futurefabric | |
float x, y; | |
int number_of_points = 17; | |
float circle_diameter = 20; | |
float plot_radius = 150; | |
void setup() { | |
size(500,500); | |
fill(0); | |
smooth(8); | |
noStroke(); | |
} | |
void draw() { | |
background(255); | |
translate(width/2, height/2); | |
for(int i=0; i<number_of_points; i++){ | |
x = plot_radius * cos(2*PI*i/number_of_points); | |
y = plot_radius * sin(2*PI*i/number_of_points); | |
ellipse(x,y,circle_diameter,circle_diameter); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment