Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions Documentation1.md

This file was deleted.

19 changes: 0 additions & 19 deletions Documentation2.md

This file was deleted.

19 changes: 0 additions & 19 deletions Documentation3.md

This file was deleted.

18 changes: 18 additions & 0 deletions Mass.md
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions Physics_Function/Physics_Function.pde
Original file line number Diff line number Diff line change
@@ -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);
}
19 changes: 19 additions & 0 deletions Pretzel.md
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions PythagoreanTheorem.md
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions Pythagorean_Theorem/Pythagorean_Theorem.pde
Original file line number Diff line number Diff line change
@@ -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);
}
42 changes: 42 additions & 0 deletions Visual_Function/Visual_Function.pde
Original file line number Diff line number Diff line change
@@ -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));
}


}