1.0.7 • Published 2 years ago

math-area v1.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Math Area

Support calculating the area of objects

Example

const mathArea = require('math-area')
mathArea.squareArea(5) // should return 25
mathArea.hypotenuseOfPythagoreanTriangle(3, 4) // should return 5
mathArea.rhombusArea(4, 5) // provides diagonal 1 and diagonal 2 as parameters

// provides (short, long, height) as paramters to calculate trapezium with short < long
// however, if you mix the short and long, for example: (5, 4, 2), it is auto switch the values.
mathArea.trapezoidArea(4, 5, 2)

mathArea.circleArea(4.5) // provides radius as a parameter

Conventions

  • Calculate area of an object:

    			[name of object in lowercase] + Area
    			For example: squareArea(5) 
    		
  • Calculate perimeter of an object:

    			[name of object in lowercase] + Perimeter
    			For example: squarePerimeter(4)
  • Calculate others:

    			[name] + Of + [name of object]
    			For example: hypotenuseOfPythagoreanTriangle(3, 4)

Support Geometry Calculations

SyntaxDescription
@v1.0.4Circle (diameter, area) Square(area, perimeter) Triangle (area, perimeter) Pythagorean Triangle (side, hypotenuse) Rectangle (area, perimeter) Trapezoid (area, perimeter) Rhombus(area, perimeter)

Note: New objects will come every week! :joy:

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago