Created
March 3, 2019 17:16
-
-
Save wonderburg7/b9e06b9727d5a844ad96038d9898dad4 to your computer and use it in GitHub Desktop.
This file contains 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
float radius = 40; | |
float x, y, z; | |
float prevX, prevY; | |
void setup() | |
{ | |
size( 700, 700 ); | |
background( 0 ); | |
stroke(255); | |
strokeWeight( 5 ); | |
x = -radius; | |
y = -(radius*sin(TWO_PI+((TWO_PI/6)*2))); | |
prevX = x; | |
prevY = y; | |
} | |
void draw() | |
{ | |
for (int i = 0; i < (width/radius)+radius; i++){ | |
for (int j = 0; j < (width/radius)+radius; j++){ | |
strokeWeight( 5 ); | |
point(x, y); | |
strokeWeight( 1 ); | |
line(x, y, x+radius*cos(TWO_PI), y+radius*sin(TWO_PI)); | |
line(x, y, x+radius*cos(TWO_PI+(TWO_PI/6)), y+radius*sin(TWO_PI+(TWO_PI/6))); | |
line(x, y, x+radius*cos(TWO_PI+((TWO_PI/6)*2)), y+radius*sin(TWO_PI+((TWO_PI/6)*2))); | |
x += radius; | |
} | |
y = y+radius*sin(TWO_PI+((TWO_PI/6)*2)); | |
z++; | |
if (z % 2 == 0){ | |
x = -(radius/2); | |
} else { | |
x = -radius; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment