From b38d2a094d8e341096bdfe62b5d6fddd401b50e8 Mon Sep 17 00:00:00 2001 From: Annie Date: Wed, 9 Dec 2015 11:46:23 -0500 Subject: [PATCH 1/6] Update Documentation1.md --- Documentation1.md | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/Documentation1.md b/Documentation1.md index 28f94fa..c69e192 100644 --- a/Documentation1.md +++ b/Documentation1.md @@ -1,19 +1,42 @@ -# Name: +# Name: Annie Zhou ## Examples: -Insert examples here. +void sinwave(){ + fill(255); + angle += radians(1); + float y = sin(angle)*300 + height/2; + x+=8; + y+=randomNumber(); + if(sizeLimit()){ + x=0; + } + ellipse(x, y, major(mouseX,mouseY),minor(mouseX,mouseY)); +} +float major(float a, float b){ + return a%4+b%3; +} +float minor(float a, float b){ + return (a+b)/15; +} +float randomNumber(){ + return random(0,20); +} +boolean sizeLimit(){ + return x>width; +} ## Description: -Insert description here +This graphic function creates a sin wave of ellipses of sizes that vary based on where your mouse is. ## Syntax: -Demonstrate syntax here - +void(){} +void(int parameters){} +void(float parameters){} +void(boolean parameters){} ##Parameters: -Name and describe parameters here - +You can have as many parameters as you like. Parameters have a primitive before them ##Returns: -What type of data does it return? +no data returned ##Other notes: Anything else? From 0a7cfd4b43e0ee483532f872443711e0103b7702 Mon Sep 17 00:00:00 2001 From: Annie Date: Wed, 9 Dec 2015 11:47:49 -0500 Subject: [PATCH 2/6] Update Documentation2.md --- Documentation2.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Documentation2.md b/Documentation2.md index 28f94fa..dcd988b 100644 --- a/Documentation2.md +++ b/Documentation2.md @@ -1,19 +1,27 @@ -# Name: +# Name: Annie Zhou ## Examples: -Insert examples here. +float pyth(float x, float y){ + hyp = sqrt(sq(x)+sq(y)); + return hyp; +} ## Description: -Insert description here +Returns the hypotenuse of a triangle ## Syntax: -Demonstrate syntax here +float name(){} +float name(parameters){} + + + +name - name of function ##Parameters: -Name and describe parameters here +You can have as many parameters as you like. ##Returns: -What type of data does it return? +a float ##Other notes: Anything else? From 3eb424c2987dbe6face6541afb1d7d49ef71417c Mon Sep 17 00:00:00 2001 From: Annie Date: Wed, 9 Dec 2015 11:48:08 -0500 Subject: [PATCH 3/6] Update Documentation1.md --- Documentation1.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation1.md b/Documentation1.md index c69e192..2dc20a4 100644 --- a/Documentation1.md +++ b/Documentation1.md @@ -29,10 +29,10 @@ boolean sizeLimit(){ This graphic function creates a sin wave of ellipses of sizes that vary based on where your mouse is. ## Syntax: -void(){} -void(int parameters){} -void(float parameters){} -void(boolean parameters){} +void name(){} +void name(int parameters){} +void name(float parameters){} +void name(boolean parameters){} ##Parameters: You can have as many parameters as you like. Parameters have a primitive before them ##Returns: From 1f82c0b3adcedd8414b91c4acb729d4af9c78e8d Mon Sep 17 00:00:00 2001 From: Annie Date: Wed, 9 Dec 2015 11:49:36 -0500 Subject: [PATCH 4/6] Update Documentation3.md --- Documentation3.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Documentation3.md b/Documentation3.md index 28f94fa..b3c7d12 100644 --- a/Documentation3.md +++ b/Documentation3.md @@ -1,19 +1,25 @@ -# Name: +# Name: Annie Zhou ## Examples: -Insert examples here. +float[] unitVector(float hyp){ + float [] thing= new float [2]; + thing[0] = mouseX/hyp; + thing[1] = mouseY/hyp; + return thing; +} ## Description: -Insert description here +Physics function that returns the unit vector of your mouse from the origin. ## Syntax: -Demonstrate syntax here +float[] name(){} +float[] name(parameters){} ##Parameters: -Name and describe parameters here +any parameters. I used a float found in a previous function. ##Returns: -What type of data does it return? +an array with 2 floats ##Other notes: Anything else? From 765c069b65b52224eea3223d8707a92c74bc8540 Mon Sep 17 00:00:00 2001 From: Annie Date: Wed, 9 Dec 2015 11:51:01 -0500 Subject: [PATCH 5/6] function --- sketch_151209a.pde | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 sketch_151209a.pde diff --git a/sketch_151209a.pde b/sketch_151209a.pde new file mode 100644 index 0000000..7b32dd1 --- /dev/null +++ b/sketch_151209a.pde @@ -0,0 +1,50 @@ +float hyp; +float angle = 0; +float x = 0; +void setup(){ + size(600,600); + background(0); +} +void draw(){ + sinwave(); + unitVector(pyth(mouseX,mouseY)); +} + +//graphic function +void sinwave(){ + fill(255); + angle += radians(1); + float y = sin(angle)*300 + height/2; + x+=8; + y+=randomNumber(); + if(sizeLimit()){ + x=0; + } + ellipse(x, y, major(mouseX,mouseY),minor(mouseX,mouseY)); +} +float major(float a, float b){ + return a%4+b%3; +} +float minor(float a, float b){ + return (a+b)/15; +} +float randomNumber(){ + return random(0,20); +} + +boolean sizeLimit(){ + return x>width; +} + +//math based function +float pyth(float x, float y){ + hyp = sqrt(sq(x)+sq(y)); + return hyp; +} +//physics based function +float[] unitVector(float hyp){ + float [] thing= new float [2]; + thing[0] = mouseX/hyp; + thing[1] = mouseY/hyp; + return thing; +} \ No newline at end of file From 894366721b42f87b852328f1f92f36a2f843eb78 Mon Sep 17 00:00:00 2001 From: Annie Date: Thu, 10 Dec 2015 08:17:49 -0500 Subject: [PATCH 6/6] Commentary --- .../sketch_151209a.pde | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) rename sketch_151209a.pde => sketch_151209a/sketch_151209a.pde (66%) diff --git a/sketch_151209a.pde b/sketch_151209a/sketch_151209a.pde similarity index 66% rename from sketch_151209a.pde rename to sketch_151209a/sketch_151209a.pde index 7b32dd1..42ccac0 100644 --- a/sketch_151209a.pde +++ b/sketch_151209a/sketch_151209a.pde @@ -11,37 +11,47 @@ void draw(){ } //graphic function +//makes a sin wave continuously across the screen void sinwave(){ fill(255); angle += radians(1); float y = sin(angle)*300 + height/2; x+=8; y+=randomNumber(); + + //once sin wave reaches end, restarts at a different place if(sizeLimit()){ x=0; } + //turns wave into circles ellipse(x, y, major(mouseX,mouseY),minor(mouseX,mouseY)); } +//varies major axis of ellipse float major(float a, float b){ return a%4+b%3; } +//varied minor axis of ellipse float minor(float a, float b){ return (a+b)/15; } +//where the y posiion of your ellipse goes float randomNumber(){ return random(0,20); } - +//tells once sin wave goes to end of screen boolean sizeLimit(){ return x>width; } //math based function +//gives the hypotenuse length from (0,0) to parameters(where mouse is) float pyth(float x, float y){ + hyp = sqrt(sq(x)+sq(y)); return hyp; } //physics based function +//finds the unit vector of where your mouse is. float[] unitVector(float hyp){ float [] thing= new float [2]; thing[0] = mouseX/hyp;