diff --git a/Documentation1.md b/Documentation1.md deleted file mode 100644 index 28f94fa..0000000 --- a/Documentation1.md +++ /dev/null @@ -1,19 +0,0 @@ -# Name: - -## Examples: -Insert examples here. - -## Description: -Insert description here - -## Syntax: -Demonstrate syntax here - -##Parameters: -Name and describe parameters here - -##Returns: -What type of data does it return? - -##Other notes: -Anything else? diff --git a/Documentation2.md b/Documentation2.md deleted file mode 100644 index 28f94fa..0000000 --- a/Documentation2.md +++ /dev/null @@ -1,19 +0,0 @@ -# Name: - -## Examples: -Insert examples here. - -## Description: -Insert description here - -## Syntax: -Demonstrate syntax here - -##Parameters: -Name and describe parameters here - -##Returns: -What type of data does it return? - -##Other notes: -Anything else? diff --git a/Documentation3.md b/Documentation3.md deleted file mode 100644 index 28f94fa..0000000 --- a/Documentation3.md +++ /dev/null @@ -1,19 +0,0 @@ -# Name: - -## Examples: -Insert examples here. - -## Description: -Insert description here - -## Syntax: -Demonstrate syntax here - -##Parameters: -Name and describe parameters here - -##Returns: -What type of data does it return? - -##Other notes: -Anything else? diff --git a/FunctionsChallenge/FunctionsChallenge.pde b/FunctionsChallenge/FunctionsChallenge.pde new file mode 100644 index 0000000..299563d --- /dev/null +++ b/FunctionsChallenge/FunctionsChallenge.pde @@ -0,0 +1,39 @@ +void setup() { + size(800, 600); +} + + +void draw() { + background(0); + //All functions in use + craftA2DimensionalSphere(20); + areaOfATriangle(15,25,0); + weight(0,20,9.81); +} + +//Visual +void craftA2DimensionalSphere(float diam) { + noCursor(); + fill(0,255,0); + ellipse(mouseX,mouseY,diam,diam); +} + +//Math +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 +float weight(float W, float m, float g){ + fill(0,0,255); + W = m * g; + textSize(50); + text(W + "N", 50,300); + return W; +} diff --git a/Math.md b/Math.md new file mode 100644 index 0000000..adb5ae4 --- /dev/null +++ b/Math.md @@ -0,0 +1,24 @@ +# Name: areaOfATriangle() + +## Examples: +areaOfATriangle(20,30,0); + +areaOfATriangle(35,10,0); + +## Description: +The areaOfATriangle() function calculates the area of a triangle using the base and height +parameters that you assign it. + +## Syntax: +areaOfATriangle(Base,Height,0) + +##Parameters: +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: +float A + +##Other notes: +The last parameter should always be entered as zero because it is the area. diff --git a/Physics.md b/Physics.md new file mode 100644 index 0000000..2d0d6bd --- /dev/null +++ b/Physics.md @@ -0,0 +1,23 @@ +# Name: weight() + +## Examples: +weight(0,20,9.81); + +weight(0,30,9.81); + +## Description: +The weight() function calculates the weight of an object using the +mass you assign it and Earth's gravity constant. + +## Syntax: +weight(0,Mass,9.81) + +##Parameters: +Mass - an integer you assign representing the mass of the object + +##Returns: +float W + +##Other notes: +The first parameter should always be zero and the last parameter should +always be 9.81 for gravity. diff --git a/Visual.md b/Visual.md new file mode 100644 index 0000000..d8ffda7 --- /dev/null +++ b/Visual.md @@ -0,0 +1,22 @@ +# Name: craftA2DimensionalSphere() + +## Examples: +craftA2DimensionalSphere(12); + +craftA2DimensionalSphere(20); + +## Description: +The craftA2DimensionalSphere() function creates a green circle that follows +the users mouse. + +## Syntax: +craftA2DimensionalSphere(diameter) + +##Parameters: +diameter- sets the diameter of the circle + +##Returns: +Void + +##Other notes: +Cursor is invisible