calc-math-area
Version:
To calculate area of mathematical shapes
20 lines (15 loc) • 338 B
JavaScript
function square(length) {
return length * 2;
}
function rectangle(length, breadth) {
return length * breadth;
}
function circle(radius) {
return Math.PI * Math.sqrt(radius);
}
function triangle(base, height) {
return base * height / 2;
}
module.exports = {
square, rectangle, circle, triangle
}