diff --git a/Documentation1.md b/Documentation1.md index 28f94fa..8bce98c 100644 --- a/Documentation1.md +++ b/Documentation1.md @@ -1,19 +1,24 @@ -# Name: +# Math Function: ## Examples: -Insert examples here. +void setup() { + background(0); +} +void draw () { + ConvertFarenheitToKelvin (0); + } ## Description: -Insert description here +With this function you can enter any farenheit value and it will print under the command line the same value, but in kelvin ## Syntax: -Demonstrate syntax here + ConvertFarenheitToKelvin (Fdeg); ##Parameters: -Name and describe parameters here +Fdeg: The farenheit value you want to convert ##Returns: -What type of data does it return? +int ##Other notes: -Anything else? +Good for scientists diff --git a/Documentation2.md b/Documentation2.md index 28f94fa..5acdafc 100644 --- a/Documentation2.md +++ b/Documentation2.md @@ -1,19 +1,24 @@ -# Name: +# Physics Function: ## Examples: -Insert examples here. +void draw () { + FinalVelocityOfObject (0, 2, 2); + } ## Description: -Insert description here +with this function you can easily find the final velocity of something by inputting the inital +velocity, the acceleration, and the time ## Syntax: -Demonstrate syntax here + FinalVelocityOfObject (a, b, c); ##Parameters: -Name and describe parameters here +a: initial velocity +b: acceleration +c: time ##Returns: -What type of data does it return? +int ##Other notes: -Anything else? +great for physics hw diff --git a/Documentation3.md b/Documentation3.md index 28f94fa..cf7a2ba 100644 --- a/Documentation3.md +++ b/Documentation3.md @@ -1,19 +1,21 @@ -# Name: +# Visual Function: ## Examples: -Insert examples here. +void draw(){ +DrawATree(300); +} ## Description: -Insert description here +Draws a cute tree that you can set the leaf size of ## Syntax: -Demonstrate syntax here +DrawATree(a); ##Parameters: -Name and describe parameters here +a: leaf size ##Returns: -What type of data does it return? +void ##Other notes: -Anything else? +time saver diff --git a/math_functions/math_functions.pde b/math_functions/math_functions.pde new file mode 100644 index 0000000..aa63614 --- /dev/null +++ b/math_functions/math_functions.pde @@ -0,0 +1,13 @@ +void setup() { + background(0); //sets background color +} +void draw () { + ConvertFarenheitToKelvin (0); //calls function +} + +int ConvertFarenheitToKelvin (int Fdeg) { // sets function and Fdeg + Fdeg += 459.7; // defines Fdeg + Fdeg = Fdeg * 5/9; //defines fdeg + println(Fdeg); //prints Fdeg in command line + return Fdeg; //returns Fdeg +} \ No newline at end of file diff --git a/physic_function/physic_function.pde b/physic_function/physic_function.pde new file mode 100644 index 0000000..8095708 --- /dev/null +++ b/physic_function/physic_function.pde @@ -0,0 +1,14 @@ +void setup () { +} + +void draw () { + FinalVelocityOfObject (0, 2, 2); //calls function + //plug in inital velocity, acceleration, and time// +} + +int FinalVelocityOfObject (int Vof0, int Acceleration, int Time) {// defines function + int finalvelocity; // sets finalvelocity as an int + finalvelocity = Vof0 + (Acceleration*Time); //defines finalvelocity + println(finalvelocity); //prints the value in the command line + return finalvelocity; //returns value +} \ 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..19477a5 --- /dev/null +++ b/visual_function/visual_function.pde @@ -0,0 +1,18 @@ +void setup(){ +size (800,600); //sets size of screen +background (0); // sets background color +} + +void draw(){ +DrawATree(300); // calls function, also defines leaveswidth +} + +void DrawATree(float leaveswidth){ //floats leaveswidth + fill(153,51,0); // sets fill +rect(height-250,width/3, 75,350); //draws rectangle +fill(51, 204, 51); // sets fill color +ellipse(height/1.5,width/3,leaveswidth,80); //draws ellipse +ellipse(height/1.5,width/2.5,leaveswidth,80);//draws ellipse +ellipse(height/1.5,width/3.5,leaveswidth,80);//draws ellipse + +} \ No newline at end of file