diff --git a/ReturningValues/ReturningValues.pde b/ReturningValues/ReturningValues.pde index 8b13789..bf9d813 100644 --- a/ReturningValues/ReturningValues.pde +++ b/ReturningValues/ReturningValues.pde @@ -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; +} \ No newline at end of file diff --git a/VoidFunctions/VoidFunctions.pde b/VoidFunctions/VoidFunctions.pde index 8b13789..0448807 100644 --- a/VoidFunctions/VoidFunctions.pde +++ b/VoidFunctions/VoidFunctions.pde @@ -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); +} \ No newline at end of file diff --git a/function notes.png b/function notes.png new file mode 100644 index 0000000..dccb0cd Binary files /dev/null and b/function notes.png differ