Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions ReturningValues/ReturningValues.pde
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
float number;
float variable = 20;
void setup() {
size(2000, 1000);
}

void draw() {
//println(divideByTwo(84));

ellipse(mouseX, mouseY, findTheHypotenuse(120, 240), findTheHypotenuse(5, 12));
println(findTheHypotenuse(50, 120));
}



float divideByTwo(float input) {
float result = input/2;
return result;
}

float findTheHypotenuse(float a, float b) {
float c = sqrt(sq(a) + sq(b));
return c;
}
68 changes: 68 additions & 0 deletions VoidFunctions/VoidFunctions.pde
Original file line number Diff line number Diff line change
@@ -1 +1,69 @@
void setup() {
//your setup code is here
size(1600, 1200);
}

void draw() {
blueSquare();
circleAtMouse(255, 200, 5);
for (int i = 0; i < height; i += 20) {
drawACircleAt(mouseX, i, 15);
}
}
void drawACircleAt(float x, float y, float d) {
ellipse(x, y, d, d);
}

void circleAtMouse(float red, float green, float blue) {
fill(red, green, blue);
ellipse(mouseX, mouseY, 100, 100);
}

void blueSquare() {
fill(0, 100, 255);
rect(width/2, height/2, 100, 100);
}


































void drawARandomCircle() {
float sz = random(5, 50);
fill(random(255), random(255), random(255));
ellipse(random(width), random(height), sz, sz);
}

void drawACircleAt(float x, float y) {
fill(255);
ellipse(x, y, 50, 50);
}
Binary file added function notes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.