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.

19 changes: 0 additions & 19 deletions Documentation3.md

This file was deleted.

39 changes: 39 additions & 0 deletions FunctionsChallenge/FunctionsChallenge.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
void setup() {
size(800, 600);
}


void draw() {
background(0);
//All functions in use
craftA2DimensionalSphere(20);
areaOfATriangle(15,25,0);
weight(0,20,9.81);
}

//Visual
void craftA2DimensionalSphere(float diam) {
noCursor();
fill(0,255,0);
ellipse(mouseX,mouseY,diam,diam);
}

//Math
float areaOfATriangle(float b, float h, float A){
fill(255,0,0);
A = .5 * b * h;
textSize(50);
text(A + "m",450,300);
textSize(25);
text("2",640,275);
return A;
}

//Physics
float weight(float W, float m, float g){
fill(0,0,255);
W = m * g;
textSize(50);
text(W + "N", 50,300);
return W;
}
24 changes: 24 additions & 0 deletions Math.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Name: areaOfATriangle()

## Examples:
areaOfATriangle(20,30,0);

areaOfATriangle(35,10,0);

## Description:
The areaOfATriangle() function calculates the area of a triangle using the base and height
parameters that you assign it.

## Syntax:
areaOfATriangle(Base,Height,0)

##Parameters:
Base - a positive interger assigning a value for the base of the triangle

Height - a positive integer assigning a value for the height of the triangle

##Returns:
float A

##Other notes:
The last parameter should always be entered as zero because it is the area.
23 changes: 23 additions & 0 deletions Physics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Name: weight()

## Examples:
weight(0,20,9.81);

weight(0,30,9.81);

## Description:
The weight() function calculates the weight of an object using the
mass you assign it and Earth's gravity constant.

## Syntax:
weight(0,Mass,9.81)

##Parameters:
Mass - an integer you assign representing the mass of the object

##Returns:
float W

##Other notes:
The first parameter should always be zero and the last parameter should
always be 9.81 for gravity.
22 changes: 22 additions & 0 deletions Visual.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Name: craftA2DimensionalSphere()

## Examples:
craftA2DimensionalSphere(12);

craftA2DimensionalSphere(20);

## Description:
The craftA2DimensionalSphere() function creates a green circle that follows
the users mouse.

## Syntax:
craftA2DimensionalSphere(diameter)

##Parameters:
diameter- sets the diameter of the circle

##Returns:
Void

##Other notes:
Cursor is invisible