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.

20 changes: 20 additions & 0 deletions math_function/math_function.pde
Original file line number Diff line number Diff line change
@@ -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;
}
21 changes: 21 additions & 0 deletions mathfunctiondescription.md
Original file line number Diff line number Diff line change
@@ -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?
13 changes: 13 additions & 0 deletions physics_function/physics_function.pde
Original file line number Diff line number Diff line change
@@ -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;
}
22 changes: 22 additions & 0 deletions physicsfunctiondescription.md
Original file line number Diff line number Diff line change
@@ -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
36 changes: 36 additions & 0 deletions visual_function/visual_finction.pde
Original file line number Diff line number Diff line change
@@ -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));
}
}
20 changes: 20 additions & 0 deletions visualfunctiondescriptionDocumentation3.md
Original file line number Diff line number Diff line change
@@ -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?