sd-mensuration-08
v1.0.0
Published
Node.js module providing functions for calculating basic mensuration formulas.
Downloads
2
Readme
Mensuration Module
This Node.js module provides functions for calculating basic mensuration formulas such as area and perimeter for common shapes like squares, rectangles, and circles.
Installation
You can install this module using npm:
npm install mensuration
## To use this module, require it in your Node.js application:
const mensuration = require('mensuration');
Example usage:
// Calculate the area of a square
console.log(mensuration.squareArea(5)); // Output: 25
// Calculate the perimeter of a square
console.log(mensuration.squarePerimeter(5)); // Output: 20
// Calculate the area of a rectangle
console.log(mensuration.rectangleArea(4, 6)); // Output: 24
// Calculate the perimeter of a rectangle
console.log(mensuration.rectanglePerimeter(4, 6)); // Output: 20
// Calculate the area of a circle
console.log(mensuration.circleArea(3)); // Output: 28.274333882308138
// Calculate the circumference of a circle
console.log(mensuration.circleCircumference(3)); // Output: 18.84955592153876
Functions
squareArea(side)
Calculates the area of a square given the length of one side.
squarePerimeter(side)
Calculates the perimeter of a square given the length of one side.
rectangleArea(length, width)
Calculates the area of a rectangle given its length and width.
rectanglePerimeter(length, width)
Calculates the perimeter of a rectangle given its length and width.
circleArea(radius)
Calculates the area of a circle given its radius.
circleCircumference(radius)
Calculates the circumference of a circle given its radius.