Skip to content

Commit

Permalink
FiguresMath
Browse files Browse the repository at this point in the history
  • Loading branch information
kry008 committed Apr 4, 2023
1 parent 910a11c commit d27e0fb
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ AllMath() - contain all classes below

BasicMath() - addition, subtraction, multiplication, division, modulo, power, absolute, squareRoot, logarithm, factorial, mathRoot, sinDegrees, cosDegrees, tanDegreese, sinRadians, cosRadians, tanRadians, round

FiguresMath() - in progress

FunctionsMath() - not set yet
```
18 changes: 18 additions & 0 deletions class/figuresMath.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class FiguresMath
{
squareArea(side)
{
return {side: side, area: side * side}
}
squarePerimeter(side)
{
return {side: side, perimeter: side * 4}
}
squareDiagonal(side)
{
return {side: side, diagonal: Math.sqrt(2 * side * side)}
}

}

module.exports = FiguresMath;
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
let BasicMath = require('./class/basicMath.js');
let FunctionsMath = require('./class/functionsMath.js');
let FiguresMath = require('./class/figuresMath.js');
class AllMath {
constructor() {
this.BasicMath = new basicMath();
this.FunctionsMath = new functionsMath();
this.FunctionsDate = new FunctionsDate();
this.FiguresMath = new figuresMath();
}

}

module.exports = {
BasicMath: BasicMath,
FunctionsMath: FunctionsMath,
FiguresMath: FiguresMath,
AllMath: AllMath
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "calc-new",
"version": "0.0.4",
"version": "0.0.5",
"description": "A small library with many math operations",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit d27e0fb

Please sign in to comment.