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

Function areaTrapezium

Maths/Area.js:130–135  ·  view source on GitHub ↗
(base1, base2, height)

Source from the content-addressed store, hash-verified

128 * @example areaTrapezium(5, 12, 10) = 85
129 */
130const areaTrapezium = (base1, base2, height) => {
131 validateNumericParam(base1, 'Base One')
132 validateNumericParam(base2, 'Base Two')
133 validateNumericParam(height, 'Height')
134 return (1 / 2) * (base1 + base2) * height
135}
136
137/**
138 * @function areaCircle

Callers

nothing calls this directly

Calls 1

validateNumericParamFunction · 0.85

Tested by

no test coverage detected