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
Binary file modified .DS_Store
Binary file not shown.
48 changes: 26 additions & 22 deletions js/formulas.js
Original file line number Diff line number Diff line change
@@ -1,80 +1,84 @@
// Basic math formulaas
function addition(num1, num2){
return -1;
}
function addition(num1, num2) {

return num1 + num2 ;

}
function subtraction(num1, num2){
return -1;
return num1 - num2 ;
}

function multiplication(num1, num2){
return -1;
return num1 * num2;
}

function division(num1, num2){
return -1;

return num1 / num2 ;
}

// Area formulaas
function areaSquare(side){
return -1;

return side**2;
}

function areaRectangle(length, width){
return -1;
return length * width;


}

function areaParallelogram(base, height){
return -1;
return base * height;
}

function areaTriangle(base, height){
return -1;
return base * height / 2;
}

function Circle(radius){
return -1;
return Math.PI * radius**2;
}

function Sphere(radius){
return -1;
return 4 * Math.PI * radius**2;
}

// Surface Area formulas
function surfaceAreaCube(side){
return -1;
return 6 * side * side ;
}

function surfaceAreaCylinder(radius, height){
return -1;
return (4 * Math.PI * radius * height) * (2 * Math.PI * radius**2);
}

// Perimeter formulas
function perimeterSquare(side){
return -1;
return side + side + side + side;
}

function perimeterRectangle(length, height){
return -1;
return length + height + length + height;
}

function perimeterTriangle(side1, side2, side3){
return -1;
return side1 + side2 + side3;
}

function perimeterCircle(diameter){
return -1;
return Math.PI * diameter;
}

// Volume formulas
function volumeCube(side){
return -1;
return side**3;
}

function volumeRectangular(length, width, height){
return -1;
return length * width * height;
}

function volumeCylinder(radius, height){
return -1;
return Math.PI * radius**2 * height;
}