Skip to content
19 changes: 0 additions & 19 deletions Documentation1.md

This file was deleted.

19 changes: 0 additions & 19 deletions Documentation2.md

This file was deleted.

2 changes: 1 addition & 1 deletion Documentation3.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Name:
# Name: draw tan function

## Examples:
Insert examples here.
Expand Down
21 changes: 21 additions & 0 deletions angle.md
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions gives_back_angle/gives_back_angle.pde
Original file line number Diff line number Diff line change
@@ -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
}
23 changes: 23 additions & 0 deletions impulse and momentum.md
Original file line number Diff line number Diff line change
@@ -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?
16 changes: 16 additions & 0 deletions impulse_and_momentum/impulse_and_momentum.pde
Original file line number Diff line number Diff line change
@@ -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)
}
33 changes: 33 additions & 0 deletions triangle.md
Original file line number Diff line number Diff line change
@@ -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:

17 changes: 17 additions & 0 deletions triangle/triangle.pde
Original file line number Diff line number Diff line change
@@ -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
}