UNPKG

geometry-and-volumes-calaculator

Version:

calcula áreas

15 lines (13 loc) 637 B
const calculatePrismVolume = (width,length,height) => { return"El volumen de prisma es: "+ width*length*height } const calculateCylinderVolume = (radius,height) => { return"El volumen de cilindro es: "+ Math.PI*Math.pow(radius,2)*height } const calculatePyramidVolume = (width,length,height) => { return"El volumen de la pirámide es: "+ (1/3)*Math.pow((width*length),2)*height } const calculateSphereVolume = (radius) => { return"El volumen de la esfera es: "+ (4/3)*Math.PI*Math.pow(radius,3) } module.exports = {calculateCylinderVolume,calculatePrismVolume,calculatePyramidVolume,calculateSphereVolume}