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 index 28f94fa..73105c9 100644 --- a/Documentation3.md +++ b/Documentation3.md @@ -1,4 +1,4 @@ -# Name: +# Name: draw tan function ## Examples: Insert examples here. diff --git a/angle.md b/angle.md new file mode 100644 index 0000000..4c352c0 --- /dev/null +++ b/angle.md @@ -0,0 +1,21 @@ +# Name: angle + +## Examples: +println(atan(50)); + +## Description: +gives back angle between bottom of screen and line in radians + +## Syntax: +atan(value) + + +##Parameters: +angle - float: angle in radians +x & y coordinates - float: position of line + +##Returns: +float + +##Other notes: +make sure while inputting value from y to subtract from the height because of the way the coordinate system works diff --git a/gives_back_angle/gives_back_angle.pde b/gives_back_angle/gives_back_angle.pde new file mode 100644 index 0000000..c893bf9 --- /dev/null +++ b/gives_back_angle/gives_back_angle.pde @@ -0,0 +1,19 @@ +//declare variables + + +void setup () { + size(800, 600); //canvas size +} + +void draw() { + background(255); //draw bg + println(angle(100,500)); +} + + + +float angle (float x, float y) { + line(0, 600, x, y); //draw line + float a = atan(sqrt(sq(mouseY) + sq(mouseX))); + return a; //angle in radians +} diff --git a/impulse and momentum.md b/impulse and momentum.md new file mode 100644 index 0000000..8e72e85 --- /dev/null +++ b/impulse and momentum.md @@ -0,0 +1,23 @@ +# Name: momentum + +## Examples: +println(momentum); + +## Description: +gives momentum when values are put in + +## Syntax: +p = sqrt(sq(px(value)) + sq(py(value)) + +##Parameters: +mass - float: mass of objects in kg +velx0, velxf, vely0, velyf - float: velocity of object in x and y direction, final and initial +px - float: x momentum +py - float: y momentum +p - float: total momentum + +##Returns: +float + +##Other notes: +Anything else? diff --git a/impulse_and_momentum/impulse_and_momentum.pde b/impulse_and_momentum/impulse_and_momentum.pde new file mode 100644 index 0000000..94fdddd --- /dev/null +++ b/impulse_and_momentum/impulse_and_momentum.pde @@ -0,0 +1,16 @@ +void setup() { + size(800, 600); // canvas size + //initialize variables +} + +void draw() { + background(193, 220, 230); //draw bg + println(m(23, 5, 8, 3, 74)); +} + +float m (float mass, float velx0, float velxf, float vely0, float velyf) { + float px = mass*velxf - mass*velx0; //x momentum + float py = mass*velyf - mass*vely0; //y momentum + float p = sqrt(sq(px) + sq(py)); //total momentum + return p; //returns momentum (kg*m/s) +} diff --git a/triangle.md b/triangle.md new file mode 100644 index 0000000..7dd5308 --- /dev/null +++ b/triangle.md @@ -0,0 +1,33 @@ +# Name: +drawtriangle +## Examples: +void setup(){ + size(800,600); + } +void draw(){ + + drawtriangle(345, 234, 578, 234, 563, 455, 43, 56, 21); +} + +## Description: +draws a triangle at a user-specified location along with a user-specified color + +## Syntax: +triangle(x1,y1,x2,y2,x3,y3); + +##Parameters: +x1: float - 1st x coordinate of triangle +y1: float - 1st y coordinate of triangle +x2: float - 2nd x coordinate of triangle +y2: float - 2nd y coordinate of triangle +x3: float - 3rd x coordinate of triangle +y3: float - 3rd y coordinate of triangle +r: float - red value of color +g: float - green value of color +b: float - blue value of color + +##Returns: +void + +##Other notes: + diff --git a/triangle/triangle.pde b/triangle/triangle.pde new file mode 100644 index 0000000..6cf6877 --- /dev/null +++ b/triangle/triangle.pde @@ -0,0 +1,17 @@ + + + +void setup () { + size(800, 600); //canvas size +} + +void draw () { + background(255) ; //draw bg + drawtriangle(234, 23, 123, 573, 742, 46, 234, 56, 56); //draws triangle w/ assigned vaues for stuff +} + +void drawtriangle(float a, float h, float c, float d, float e, float f, float r, float g, float b) { //create function for traingle + + triangle(a, h, c, d, e, f); //draws traingle at assinged locations + fill(r, g, b); //color of triangle +} \ No newline at end of file