-
-
Save jkwok91/fdc1a588e6ebc03a8022 to your computer and use it in GitHub Desktop.
something simple to draft something else i want to do
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
/* | |
includes Point, Triangl, EqTri1 classes, as well as the drawLine method | |
*/ | |
int w = 200; | |
int h = 200; | |
color c = color(255,255,0); //yellow! | |
Point apex; | |
int rad; | |
double halfside; | |
double altitude; | |
void setup() { | |
size(w,h); | |
background(0); | |
frameRate(12); | |
apex = new Point(w/2,h/2); | |
rad = 30; | |
} | |
void draw() { | |
clear(); | |
EqTri1 t1 = new EqTri1(apex,rad); | |
t1.drawT(); | |
rad = (int)(Math.random()*10+10); | |
halfside = rad*(Math.sin(Math.PI/3)); | |
altitude = rad*3/2; | |
apex.xcor = (int)(Math.random()*(width-2*(halfside+1))+(halfside+1)); | |
apex.ycor = (int)(Math.random()*(height-2*(altitude+1))+(altitude+1)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment