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/math_function/math_function.pde b/math_function/math_function.pde new file mode 100644 index 0000000..806516e --- /dev/null +++ b/math_function/math_function.pde @@ -0,0 +1,20 @@ +void setup () { + size(600, 600); //draw canvas for mouseX and mouseY inputs +} + +void draw () { + background(255); //draw a white background + println(convertmeterstomiles(10)); //print out resulting miles from meters + println(convertinchestokm(10)); //print out resulting kilometers from inches +} + + +float convertmeterstomiles (float x) { //convert meters to miles + float result = x * 1000 * .625; + return result; +} + +float convertinchestokm (float y) { //convert inches to kilometers + float result = y * .0833 * .0001 * .625; + return result; +} diff --git a/mathfunctiondescription.md b/mathfunctiondescription.md new file mode 100644 index 0000000..b5263e5 --- /dev/null +++ b/mathfunctiondescription.md @@ -0,0 +1,21 @@ +# Name: +Unit Conversions (2 options) +## Examples: +println(convertmeterstomiles(10)), 10 meters = 6250 miles; +println(convertinchestokm(10)), 10 inches = 5.206 x 10^-5 km + +## Description: +Converts inches to kilometers and meters to miles + +## Syntax: +(x, y) + +##Parameters: +x = inputted x value +y = inputted y value + +##Returns: +Float + +##Other notes: +Anything else? diff --git a/physics_function/physics_function.pde b/physics_function/physics_function.pde new file mode 100644 index 0000000..cdf56fc --- /dev/null +++ b/physics_function/physics_function.pde @@ -0,0 +1,13 @@ +void setup () { + size(800,800); //make a canvas +} + + +void draw () { + println(finalspeed(2,4,8)); //input displacement of 2m, initial velocity of 4m/s, and acceleration of 8m/s^2 +} + +float finalspeed (float x, float Vo, float a) { //finding final speed given displacement, initial velocity, and acceleration + float result = sqrt(pow(Vo,2) + 2*x*a); //using formula Vf^2=Vo^2+2ax + return result; +} \ No newline at end of file diff --git a/physicsfunctiondescription.md b/physicsfunctiondescription.md new file mode 100644 index 0000000..0915e16 --- /dev/null +++ b/physicsfunctiondescription.md @@ -0,0 +1,22 @@ +# Name: +Finding final speed of an object +## Examples: +println(finalspeed(2,4,8)), +final speed = 6.928203 + +## Description: +after giving the displacement, initial velocity, and acceleration, this function will give you the object's final velocity + +## Syntax: +float finalspeed (float x, float Vo, float a) + +##Parameters: +float x = displacement +float Vo = initial velocity +float a = acceleration + +##Returns: +float + +##Other notes: +uses the equation (Vf)^2 = (Vi)^2 + 2ax diff --git a/visual_function/visual_finction.pde b/visual_function/visual_finction.pde new file mode 100644 index 0000000..cb43c4b --- /dev/null +++ b/visual_function/visual_finction.pde @@ -0,0 +1,36 @@ +PImage images; //declare image variables +int count = 600; //max # of balls to appear +float [] x = new float[count]; //declare variables for x & y location and diameter +float [] y = new float[count]; +float [] diam = new float[count]; + +void setup () { + size(800,800); + images = loadImage("images.jpg"); //bring the image into the processing file + for (int i = 0; i < count; i++) { //set random values for x & y location and diameter + x[i] = random(0,800); + y[i] = random(0,800); + diam[i] = random(0,10); + } +} + +void draw () { + background(56, 255, 221); //give a light blue background + image(images, 250, 250); //draw the chosen image and establish its location + Pimage(); + DrawArrayofCircles(); //use this function to draw an array of circles +} + +void DrawArrayofCircles () { + for (int i = 0; i < count; i++) { + fill(random(255),random(255),random(255)); //give each new ball a random fill + ellipse(x[i], y[i], diam[i], diam[i]); //draw circles randomly + } +} + +void Pimage () { + image(images, 250, 250); //draw the chosen image and establish its location + if (keyPressed) { //if any key is pressed, give a random tint + tint(random(255),random(255),random(255)); + } +} diff --git a/visualfunctiondescriptionDocumentation3.md b/visualfunctiondescriptionDocumentation3.md new file mode 100644 index 0000000..77ce256 --- /dev/null +++ b/visualfunctiondescriptionDocumentation3.md @@ -0,0 +1,20 @@ +# Name: +Background w/ array of circles +## Examples: + + +## Description: +Plots a picture in the middle of the canvas as an array of circles appear. If any key is pressed, the tint on the pic will change. + +## Syntax: +Pimage () +DrawArrayofCircles () + +##Parameters: +no parameters + +##Returns: +void + +##Other notes: +Anything else?