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

Function areaRhombus

Maths/Area.js:159–163  ·  view source on GitHub ↗
(diagonal1, diagonal2)

Source from the content-addressed store, hash-verified

157 * @example areaRhombus(12, 10) = 60
158 */
159const areaRhombus = (diagonal1, diagonal2) => {
160 validateNumericParam(diagonal1, 'diagonal one')
161 validateNumericParam(diagonal2, 'diagonal two')
162 return (1 / 2) * diagonal1 * diagonal2
163}
164
165const validateNumericParam = (param, paramName = 'param') => {
166 if (typeof param !== 'number') {

Callers

nothing calls this directly

Calls 1

validateNumericParamFunction · 0.85

Tested by

no test coverage detected