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
15 changes: 8 additions & 7 deletions Documentation1.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
# Name:
Force()

## Examples:
Insert examples here.
Force(10,5)
Returns 50

## Description:
Insert description here
Calculates force by multilying mass and acceleration.

## Syntax:
Demonstrate syntax here
force(m,a)

##Parameters:
Name and describe parameters here
float m - mass
float a - acceleration

##Returns:
What type of data does it return?
float f - force

##Other notes:
Anything else?
18 changes: 10 additions & 8 deletions Documentation2.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
# Name:
slope()

## Examples:
Insert examples here.
slope(14,15,12,16)
Returns -.5

## Description:
Insert description here
Calculates the slope of a line from two points on the line

## Syntax:
Demonstrate syntax here
slope(r1x,r1y,r2x,r2y)

##Parameters:
Name and describe parameters here
float r1x - x coordinate of first point
float r1y - y coordinate of first point
float r2x - x coordinate of second point
float r2y - y coordinate of second point

##Returns:
What type of data does it return?

##Other notes:
Anything else?
float m - slope
16 changes: 9 additions & 7 deletions Documentation3.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
# Name:
donut()

## Examples:
Insert examples here.
donut(width/2,height/2,200)
Draws a donut in the middle of the window.

## Description:
Insert description here
Draws a colored circle then a black circle 1/3 its size

## Syntax:
Demonstrate syntax here
donut(x,y,diam);

##Parameters:
Name and describe parameters here
x - x coordinate of donut
y - y coordinate of donut
diam - diameter of donut

##Returns:
What type of data does it return?
Displays donut

##Other notes:
Anything else?
31 changes: 31 additions & 0 deletions FunctionsChallenge/FunctionsChallenge.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//physics
float force(float m, float a) {
float F = m*a;
return F;
}

//math
float slope(float r1x, float r1y, float r2x, float r2y) {
float m = (r2y - r1y)/(r2x-r1x);
return m;
}

//visual
void donut(float x, float y, float diam){
fill(random(255),random(255),random(255));
ellipse(x,y, diam, diam);
fill(0);
ellipse(x,y, diam/3,diam/3);
}

void setup(){
background(0);
size(800,600);
noStroke();
}

void draw() {
println(force(10, 5));
println(slope(14, 15, 12, 16));
donut(width/2,height/2,200);
}