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/Mass.md b/Mass.md new file mode 100644 index 0000000..7ef3b0c --- /dev/null +++ b/Mass.md @@ -0,0 +1,18 @@ +# Name: +Mass() + +## Examples: +Mass(20); +Mass(110); + +## Description: +This function converts weight to mass in kilograms. + +## Syntax: +Mass(w) + +##Parameters: +w float: the weight the user wishes to convert + +##Returns: +none diff --git a/Physics_Function/Physics_Function.pde b/Physics_Function/Physics_Function.pde new file mode 100644 index 0000000..248ac54 --- /dev/null +++ b/Physics_Function/Physics_Function.pde @@ -0,0 +1,19 @@ +float m; //declare variables for mass and acceleration, acceleration equals 9.81 m/s^2 on Earth +float a = 9.81; +void setup() { + background(0); //setup size and background + size(600, 600); +} + +void draw() { + Mass(0); //insert function and weight in parentheses (in kilograms) +} + + + + +void Mass(float w) { //function is called Mass + m = w/a; // equation for mass is weight divided by acceleration + textSize(50); //setup for text size and location + text(m + " kg", 150, 300); +} \ No newline at end of file diff --git a/Pretzel.md b/Pretzel.md new file mode 100644 index 0000000..bdcacbb --- /dev/null +++ b/Pretzel.md @@ -0,0 +1,19 @@ +# Name: +Pretzel() + +## Examples: +Preztel(75,60); +Pretzel(20,20); + +## Description: +An ellipse creates the shape of a pretzel. + +## Syntax: +Pretzel(width,height); + +##Parameters: +width float: makes preztel wider +height float: makes pretzel taller + +##Returns: +none diff --git a/PythagoreanTheorem.md b/PythagoreanTheorem.md new file mode 100644 index 0000000..08b29d6 --- /dev/null +++ b/PythagoreanTheorem.md @@ -0,0 +1,21 @@ +# Name: +PythagoreanTheorem() + +## Examples: +PythagoreanTheorem(12,4,0); +PythagoreanTheorem(40,18,0); + +## Description: +The function solves for c in the equation a^2+b^2=c^2. + +## Syntax: +PythagoreanTheorem(a,b,c); + +##Parameters: +a float: side a +b float: side b +c float: side c, must be zero + + +##Returns: +none diff --git a/Pythagorean_Theorem/Pythagorean_Theorem.pde b/Pythagorean_Theorem/Pythagorean_Theorem.pde new file mode 100644 index 0000000..a03bbf2 --- /dev/null +++ b/Pythagorean_Theorem/Pythagorean_Theorem.pde @@ -0,0 +1,14 @@ +void setup() { + size(600, 600); //setup for size and background color + background(0); +} + +void draw() { + PythagoreanTheorem(25, 16, 0); //function is put into void draw +} + +void PythagoreanTheorem(float a, float b, float c) { //name of function is PythagoreanTheorem and requires 3 variables to solve the equation (a,b,c) + c = sqrt(a*a + b*b); //this is the equation that will solve for c + textSize(50); //textSize and text displays the answer + text(c, 200, 300); +} \ No newline at end of file diff --git a/Visual_Function/Visual_Function.pde b/Visual_Function/Visual_Function.pde new file mode 100644 index 0000000..b7f6a18 --- /dev/null +++ b/Visual_Function/Visual_Function.pde @@ -0,0 +1,42 @@ +float x; // delcares variables for location and velocity +float y; +float vx; +float vy; +void setup() { + background(0); //setup for background color and size + size(800, 600); + x=0; //gives the variables a value + y=200; + vx=10; + vy=10; +} + +void draw() { + Pretzel(50,50); //the function is put here. variables can be used to change size of the ellipse +} + + +void Pretzel(float a,float b) { + noStroke(); //setup for ellipse + ellipse(x,y,a,b); + x=x+vx; //setup for velocity + y=y+vy; + if (y>=height) { //the changes in velocity make the ellipse travel in the shape of a pretzel + vy=-vy; + fill(random(255), random(255), random(255)); + } + if (x>=width) { + vx=-vx; + fill(random(255), random(255), random(255)); + } + if (y<=0) { + vy=-vy; + fill(random(255), random(255), random(255)); + } + if (x<=0) { + vx=-vx; + fill(random(255), random(255), random(255)); + } + + +} \ No newline at end of file