diff --git a/ReturningValues/ReturningValues.pde b/ReturningValues/ReturningValues.pde index 8b13789..d36d735 100644 --- a/ReturningValues/ReturningValues.pde +++ b/ReturningValues/ReturningValues.pde @@ -1 +1,48 @@ + +//void setup(){ + + +/************************************************* +} + + +//pythagorean theorem + +void draw(){ + + println(hypot(5,12)); //write a new line each frame of the hypot function with values 5 and 12 for a and b + +} + +float hypot(float a, float b){ //float new function with variables a and b +float c = sqrt(sq(a) + sq(b)); //pythagorean theorem +return c; //repeat +} + + +//c = square root of (a squared +b squared) +//sqrt(num); +//sq(num); + + + + +**********************************/ + + +//add three values together +void setup(){ + + +} + +void draw(){ + + println(numbers(1,2,3)); +} + +float numbers(float a, float b, float c){ + float d = a+b+c; + return d; +} \ No newline at end of file diff --git a/VoidFunctions/VoidFunctions.pde b/VoidFunctions/VoidFunctions.pde index 8b13789..8beef2f 100644 --- a/VoidFunctions/VoidFunctions.pde +++ b/VoidFunctions/VoidFunctions.pde @@ -1 +1,35 @@ +float a, b, c; +PImage asoue; +void setup() { + size(800, 600); + + asoue = loadImage("asoue.jpg"); +} +void draw() { + background(255); + drawabluesquare(); + drawacircle(); + drawanimage(mouseX,mouseY); +} + +void drawabluesquare() { + fill(0, 0, 255); + rect(375, 275, 50, 50); +} + +void drawacircle() { + setfill(40,195,255); + ellipse(mouseX, mouseY, 30, 30); + + +} + +void drawanimage(float x, float y) { + + image(asoue, x,y); +} + +void setfill(float r, float g, float b){ + fill(r,g,b); +} \ No newline at end of file diff --git a/VoidFunctions/data/asoue.jpg b/VoidFunctions/data/asoue.jpg new file mode 100644 index 0000000..a96d795 Binary files /dev/null and b/VoidFunctions/data/asoue.jpg differ