Contact: aviboots(AT)netvision.net.il
41,551 questions
54,171 answers
573 users
function pentagon_area(side, apothem) { return 5.0 * (side * apothem) / 2.0; } const side = 5.0; const apothem = 3.0; const area = pentagon_area(side, apothem); console.log(`Area = ${area.toFixed(2)}`); /* run: Area = 37.50 */
function area_regular_pentagon(side) { return (1 / 4) * Math.sqrt(5 * (5 + 2 * Math.sqrt(5))) * (side ** 2); } console.log(area_regular_pentagon(7)); /* run: 84.30339262885938 */