File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -2415,10 +2415,10 @@ <h6 style="font-size:160%;margin:7px">Area of a circle</h6>
24152415
24162416function 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 =
You can’t perform that action at this time.
0 commit comments