From 4a33af7167e3fb2b115dab45409e4e7de8c1b691 Mon Sep 17 00:00:00 2001 From: Agersh88 Date: Tue, 8 Dec 2015 13:52:39 -0500 Subject: [PATCH 01/16] Initial File --- FunctionsChallenge/FunctionsChallenge.pde | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FunctionsChallenge/FunctionsChallenge.pde diff --git a/FunctionsChallenge/FunctionsChallenge.pde b/FunctionsChallenge/FunctionsChallenge.pde new file mode 100644 index 0000000..e69de29 From de3a14209dd9c9884fdadee6bf4241ca0956b06a Mon Sep 17 00:00:00 2001 From: Agersh88 Date: Tue, 8 Dec 2015 14:41:02 -0500 Subject: [PATCH 02/16] added visual function --- FunctionsChallenge/FunctionsChallenge.pde | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/FunctionsChallenge/FunctionsChallenge.pde b/FunctionsChallenge/FunctionsChallenge.pde index e69de29..88e252b 100644 --- a/FunctionsChallenge/FunctionsChallenge.pde +++ b/FunctionsChallenge/FunctionsChallenge.pde @@ -0,0 +1,22 @@ +void setup() { + size(800, 600); +} + + +void draw() { + background(0); + craftA2DimensionalSphere(20); +} + + +void craftA2DimensionalSphere(float diam) { + noCursor(); + fill(0,255,0); + ellipse(mouseX,mouseY,diam,diam); +} + + +void diameter(float d, float r){ + d = r * 2; + text(d,mouseX + 20,mouseY - 20); +} \ No newline at end of file From 88e60f0a076e2696e195ff2bee7d1eee638e05fc Mon Sep 17 00:00:00 2001 From: Agersh88 Date: Tue, 8 Dec 2015 14:52:34 -0500 Subject: [PATCH 03/16] a --- FunctionsChallenge/FunctionsChallenge.pde | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/FunctionsChallenge/FunctionsChallenge.pde b/FunctionsChallenge/FunctionsChallenge.pde index 88e252b..709ed38 100644 --- a/FunctionsChallenge/FunctionsChallenge.pde +++ b/FunctionsChallenge/FunctionsChallenge.pde @@ -5,7 +5,7 @@ void setup() { void draw() { background(0); - craftA2DimensionalSphere(20); + craftA2DimensionalSphere(diameter); } @@ -16,7 +16,8 @@ void craftA2DimensionalSphere(float diam) { } -void diameter(float d, float r){ - d = r * 2; +void diameter(float r){ + float d = r * 2; text(d,mouseX + 20,mouseY - 20); + return d; } \ No newline at end of file From 60b6baec82b212148191ed46336c0126d6b797e1 Mon Sep 17 00:00:00 2001 From: Agersh88 Date: Wed, 9 Dec 2015 13:55:14 -0500 Subject: [PATCH 04/16] added math function --- FunctionsChallenge/FunctionsChallenge.pde | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/FunctionsChallenge/FunctionsChallenge.pde b/FunctionsChallenge/FunctionsChallenge.pde index 709ed38..8eee72d 100644 --- a/FunctionsChallenge/FunctionsChallenge.pde +++ b/FunctionsChallenge/FunctionsChallenge.pde @@ -5,7 +5,8 @@ void setup() { void draw() { background(0); - craftA2DimensionalSphere(diameter); + craftA2DimensionalSphere(20); + areaOfATriangle(15,25,0); } @@ -15,9 +16,9 @@ void craftA2DimensionalSphere(float diam) { ellipse(mouseX,mouseY,diam,diam); } - -void diameter(float r){ - float d = r * 2; - text(d,mouseX + 20,mouseY - 20); - return d; +void areaOfATriangle(float b, float h, float A){ + fill(255,0,0); + A = .5 * b * h; + textSize(50); + text(A,400,300); } \ No newline at end of file From 65661011cf5ce7158ef4ac02d53a1db7f58b1036 Mon Sep 17 00:00:00 2001 From: Agersh88 Date: Wed, 9 Dec 2015 14:41:22 -0500 Subject: [PATCH 05/16] Added Physics function Function that calculates weight given the mass and using 9.81 as Earth's gravity constant. --- FunctionsChallenge/FunctionsChallenge.pde | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/FunctionsChallenge/FunctionsChallenge.pde b/FunctionsChallenge/FunctionsChallenge.pde index 8eee72d..608024d 100644 --- a/FunctionsChallenge/FunctionsChallenge.pde +++ b/FunctionsChallenge/FunctionsChallenge.pde @@ -5,20 +5,33 @@ void setup() { void draw() { background(0); + //All functions in use craftA2DimensionalSphere(20); areaOfATriangle(15,25,0); + weight(0,20,9.81); } - +//Function that creates circle void craftA2DimensionalSphere(float diam) { noCursor(); fill(0,255,0); ellipse(mouseX,mouseY,diam,diam); } +//Function that calculates area of a triangle void areaOfATriangle(float b, float h, float A){ fill(255,0,0); A = .5 * b * h; textSize(50); - text(A,400,300); + text(A + "m",450,300); + textSize(25); + text("2",640,275); +} + +//Function that calculates weight +void weight(float W, float m, float g){ + fill(0,0,255); + W = m * g; + textSize(50); + text(W + "N", 50,300); } \ No newline at end of file From 04520f399e2cd474a153b69297f4d82342173eba Mon Sep 17 00:00:00 2001 From: Agersh88 Date: Thu, 10 Dec 2015 11:16:46 -0500 Subject: [PATCH 06/16] fixed labels of functions --- FunctionsChallenge/FunctionsChallenge.pde | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/FunctionsChallenge/FunctionsChallenge.pde b/FunctionsChallenge/FunctionsChallenge.pde index 608024d..e843a5c 100644 --- a/FunctionsChallenge/FunctionsChallenge.pde +++ b/FunctionsChallenge/FunctionsChallenge.pde @@ -11,14 +11,14 @@ void draw() { weight(0,20,9.81); } -//Function that creates circle +//Visual void craftA2DimensionalSphere(float diam) { noCursor(); fill(0,255,0); ellipse(mouseX,mouseY,diam,diam); } -//Function that calculates area of a triangle +//Math void areaOfATriangle(float b, float h, float A){ fill(255,0,0); A = .5 * b * h; @@ -28,7 +28,7 @@ void areaOfATriangle(float b, float h, float A){ text("2",640,275); } -//Function that calculates weight +//Physics void weight(float W, float m, float g){ fill(0,0,255); W = m * g; From 6155fc3566827a1bbdf7170a465c16c4590efe84 Mon Sep 17 00:00:00 2001 From: Agersh88 Date: Thu, 10 Dec 2015 11:26:55 -0500 Subject: [PATCH 07/16] Update Documentation1.md --- Documentation1.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Documentation1.md b/Documentation1.md index 28f94fa..725ae28 100644 --- a/Documentation1.md +++ b/Documentation1.md @@ -1,16 +1,19 @@ -# Name: +# Name: craftA2DimensionalSphere ## Examples: -Insert examples here. +craftA2DimensionalSphere(12); + +craftA2DimensionalSphere(20); ## Description: -Insert description here +The craftA2DimensionalSphere() function creates a green circle that follows +the users mouse. ## Syntax: -Demonstrate syntax here +craftA2DimensionalSphere(diameter) ##Parameters: -Name and describe parameters here +diameter- sets the diameter of the circle ##Returns: What type of data does it return? From 64061c7f8a4da40598b3d18eb9d005cb70b491d7 Mon Sep 17 00:00:00 2001 From: Agersh88 Date: Thu, 10 Dec 2015 13:35:27 -0500 Subject: [PATCH 08/16] Update Documentation1.md --- Documentation1.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation1.md b/Documentation1.md index 725ae28..7a41868 100644 --- a/Documentation1.md +++ b/Documentation1.md @@ -16,7 +16,7 @@ craftA2DimensionalSphere(diameter) diameter- sets the diameter of the circle ##Returns: -What type of data does it return? +Void ##Other notes: -Anything else? +Cursor is invisible From 92bfad87caacc4b103997f9351ab7386fa1eda2a Mon Sep 17 00:00:00 2001 From: Agersh88 Date: Mon, 14 Dec 2015 11:54:49 -0500 Subject: [PATCH 09/16] Update FunctionsChallenge.pde --- FunctionsChallenge/FunctionsChallenge.pde | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/FunctionsChallenge/FunctionsChallenge.pde b/FunctionsChallenge/FunctionsChallenge.pde index e843a5c..299563d 100644 --- a/FunctionsChallenge/FunctionsChallenge.pde +++ b/FunctionsChallenge/FunctionsChallenge.pde @@ -19,19 +19,21 @@ void craftA2DimensionalSphere(float diam) { } //Math -void areaOfATriangle(float b, float h, float A){ +float areaOfATriangle(float b, float h, float A){ fill(255,0,0); A = .5 * b * h; textSize(50); text(A + "m",450,300); textSize(25); text("2",640,275); + return A; } //Physics -void weight(float W, float m, float g){ +float weight(float W, float m, float g){ fill(0,0,255); W = m * g; textSize(50); text(W + "N", 50,300); -} \ No newline at end of file + return W; +} From 0b2c82153b87230173e8eb2ca68b9af9db8624f9 Mon Sep 17 00:00:00 2001 From: Agersh88 Date: Mon, 14 Dec 2015 13:45:29 -0500 Subject: [PATCH 10/16] Update Documentation2.md --- Documentation2.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Documentation2.md b/Documentation2.md index 28f94fa..d569982 100644 --- a/Documentation2.md +++ b/Documentation2.md @@ -1,19 +1,24 @@ -# Name: +# Name: areaOfATriangle ## Examples: -Insert examples here. +areaOfATriangle(20,30,0); + +areaOfATriangle(35,10,0); ## Description: -Insert description here +The areaOfATriangle() function calculates the area of a triangle using the base and height +parameters that you assign it. ## Syntax: -Demonstrate syntax here +areaOfATriangle(Base,Height,0) ##Parameters: -Name and describe parameters here +Base - a positive interger assigning a value for the base of the triangle + +Height - a positive integer assigning a value for the height of the triangle ##Returns: -What type of data does it return? +float A ##Other notes: -Anything else? +The last parameter should always be entered as zero because it is the area. From 858a48d2eb16bc1761286a5ad94fc5572a3793e3 Mon Sep 17 00:00:00 2001 From: Agersh88 Date: Mon, 14 Dec 2015 15:16:27 -0500 Subject: [PATCH 11/16] Update Documentation1.md --- Documentation1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation1.md b/Documentation1.md index 7a41868..d8ffda7 100644 --- a/Documentation1.md +++ b/Documentation1.md @@ -1,4 +1,4 @@ -# Name: craftA2DimensionalSphere +# Name: craftA2DimensionalSphere() ## Examples: craftA2DimensionalSphere(12); From eb697a93458b39457f7e2d75764f372e70856292 Mon Sep 17 00:00:00 2001 From: Agersh88 Date: Mon, 14 Dec 2015 15:16:45 -0500 Subject: [PATCH 12/16] Update Documentation2.md --- Documentation2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation2.md b/Documentation2.md index d569982..adb5ae4 100644 --- a/Documentation2.md +++ b/Documentation2.md @@ -1,4 +1,4 @@ -# Name: areaOfATriangle +# Name: areaOfATriangle() ## Examples: areaOfATriangle(20,30,0); From c3e944154b671f4e079330eefda0753529114c81 Mon Sep 17 00:00:00 2001 From: Agersh88 Date: Mon, 14 Dec 2015 15:25:20 -0500 Subject: [PATCH 13/16] Update Documentation3.md --- Documentation3.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Documentation3.md b/Documentation3.md index 28f94fa..2d0d6bd 100644 --- a/Documentation3.md +++ b/Documentation3.md @@ -1,19 +1,23 @@ -# Name: +# Name: weight() ## Examples: -Insert examples here. +weight(0,20,9.81); + +weight(0,30,9.81); ## Description: -Insert description here +The weight() function calculates the weight of an object using the +mass you assign it and Earth's gravity constant. ## Syntax: -Demonstrate syntax here +weight(0,Mass,9.81) ##Parameters: -Name and describe parameters here +Mass - an integer you assign representing the mass of the object ##Returns: -What type of data does it return? +float W ##Other notes: -Anything else? +The first parameter should always be zero and the last parameter should +always be 9.81 for gravity. From e2df018ca180ea32fbff37b4aef61da779769e3d Mon Sep 17 00:00:00 2001 From: Agersh88 Date: Mon, 14 Dec 2015 15:27:46 -0500 Subject: [PATCH 14/16] Rename Documentation1.md to Visual.md --- Documentation1.md => Visual.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Documentation1.md => Visual.md (100%) diff --git a/Documentation1.md b/Visual.md similarity index 100% rename from Documentation1.md rename to Visual.md From 1fd19a0d6f4f4280e73382f0e3a87c9d8b27d5c2 Mon Sep 17 00:00:00 2001 From: Agersh88 Date: Mon, 14 Dec 2015 15:28:10 -0500 Subject: [PATCH 15/16] Rename Documentation2.md to Math.md --- Documentation2.md => Math.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Documentation2.md => Math.md (100%) diff --git a/Documentation2.md b/Math.md similarity index 100% rename from Documentation2.md rename to Math.md From 5acf6d4a9b1e983c391604ab1946e5936a4dd70f Mon Sep 17 00:00:00 2001 From: Agersh88 Date: Mon, 14 Dec 2015 15:28:29 -0500 Subject: [PATCH 16/16] Rename Documentation3.md to Physics.md --- Documentation3.md => Physics.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Documentation3.md => Physics.md (100%) diff --git a/Documentation3.md b/Physics.md similarity index 100% rename from Documentation3.md rename to Physics.md