MCPcopy Create free account
hub / github.com/TheAlgorithms/JavaScript / volTriangularPrism

Function volTriangularPrism

Maths/Volume.js:76–81  ·  view source on GitHub ↗
(baseLengthTriangle, heightTriangle, height)

Source from the content-addressed store, hash-verified

74 return 1 / 2 * baseLengthTriangle * heightTriangle * height
75*/
76const volTriangularPrism = (baseLengthTriangle, heightTriangle, height) => {
77 isNumber(baseLengthTriangle, 'BaseLengthTriangle')
78 isNumber(heightTriangle, 'HeightTriangle')
79 isNumber(height, 'Height')
80 return (1 / 2) * baseLengthTriangle * heightTriangle * height
81}
82
83/*
84 Calculate the volume for a Pentagonal Prism

Callers

nothing calls this directly

Calls 1

isNumberFunction · 0.85

Tested by

no test coverage detected