Created
September 22, 2018 16:07
-
-
Save wonderburg7/ef003975a64e0e8ea04132948039a95d 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
int edgedistance = 400; | |
int gridpoints = 10; | |
int griddistance = (4000-400-400)/gridpoints; | |
int x1 = 4000 - edgedistance; | |
int y1 = edgedistance; | |
int x2 = edgedistance; | |
int y2 = edgedistance+griddistance; | |
void setup() { | |
size(4000,4000); | |
background(78, 123, 41); | |
strokeWeight(3); | |
stroke(random(256), random(256), random(256), 255); | |
noLoop(); | |
// rect(edgedistance, edgedistance, height-(edgedistance*2), height-(edgedistance*2)); | |
int[] xarray = new int[gridpoints]; | |
int[] yarray = new int[gridpoints]; | |
xarray[0] = edgedistance; | |
yarray[0] = edgedistance; | |
for (int 1 = 1; j < gridpoints; j++){ | |
xarray[j] = xarray[j-1]+griddistance; | |
} | |
for (int 1 = 1; j < gridpoints; j++){ | |
yarray[j] = xarray[j-1]+griddistance; | |
} | |
} | |
void draw() { | |
/* | |
for (int j = 0; j < ; j++){ | |
for (int i = 0; i < ; i++){ | |
*/ | |
line(xarray[], yarray[],xarray[], yarray[]); | |
} | |
} | |
save("graph.png"); | |
} | |
/*if (y1 == edgedistance && x1 >= (edgedistance+griddistance) && x1 <= (height-edgedistance)){ | |
x1 = x1 - griddistance; | |
} else if (x1 == edgedistance && y1 >= (edgedistance) && y1 <= (height-edgedistance-griddistance)){ | |
y1 = y1 + griddistance; | |
} else if (y1 == height - edgedistance && x1 >= (edgedistance+griddistance) && x1 <= (height-edgedistance-griddistance)){ | |
x1 = x1 + griddistance; | |
} else if (x1 == height - edgedistance && y1 >= (edgedistance+griddistance) && y1 <= (height-edgedistance)){ | |
y1 = y1 - griddistance; | |
} | |
if (y2 == edgedistance && x2 >= (edgedistance+griddistance) && x2 <= (height-edgedistance)){ | |
x2 = x2 - griddistance; | |
} else if (x2 == edgedistance && y2 >= (edgedistance) && y2 <= (height-edgedistance-griddistance)){ | |
y2 = y2 + griddistance; | |
} else if (y2 == height - edgedistance && x2 >= (edgedistance+griddistance) && x2 <= (height-edgedistance-griddistance)){ | |
x2 = x2 + griddistance; | |
} else if (x2 == height - edgedistance && y2 >= (edgedistance+griddistance) && y2 <= (height-edgedistance)){ | |
y2 = y2 - griddistance; | |
}*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment