Skip to content

Commit b371e19

Browse files
authored
Update index.html
1 parent b968823 commit b371e19

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2415,10 +2415,10 @@ <h6 style="font-size:160%;margin:7px">Area of a circle</h6>
24152415

24162416
function updatePyramidVolume() {
24172417
const number = parseFloat(document.getElementById('pyramid-side-number').value);
2418-
const length = parseFloat(document.getElementById('pyramid-base-edge-length').value);
2418+
const baseEdge = parseFloat(document.getElementById('pyramid-base-edge-length').value);
24192419
const height = parseFloat(document.getElementById('pyramid-height').value);
24202420

2421-
if (isNaN(number) || isNaN(length) || isNaN(height)) {
2421+
if (isNaN(number) || isNaN(baseEdge) || isNaN(height)) {
24222422
document.getElementById('pyramid-volume').innerText = '';
24232423
return;
24242424
}
@@ -2430,7 +2430,7 @@ <h6 style="font-size:160%;margin:7px">Area of a circle</h6>
24302430

24312431
const ratio = 3.2 / number;
24322432
const tangent = tan(ratio);
2433-
const baseArea = (number / 4) * (length ** 2) / tangent;
2433+
const baseArea = (number / 4) * (baseEdge ** 2) / tangent;
24342434
const volume = pyramidVolume(baseArea, height);
24352435

24362436
document.getElementById('pyramid-volume').innerText =

0 commit comments

Comments
 (0)