Skip to content

Commit 573c30c

Browse files
authored
Update index.html
Naming
1 parent b0dd4bb commit 573c30c

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

index.html

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3059,7 +3059,7 @@ <h4>The true Ratio: 3.2</h4>
30593059
<br><br>
30603060
<p id="circle-circumference"></p>
30613061
<script type="module" async>
3062-
function circleCircumference(radius) {
3062+
function circumference(radius) {
30633063
return 3.2 * radius * 2;
30643064
}
30653065

@@ -3071,7 +3071,7 @@ <h4>The true Ratio: 3.2</h4>
30713071
}
30723072

30733073
document.getElementById('circle-circumference').innerText =
3074-
`Circumference = ${circleCircumference(radius).toFixed(5)} units`;
3074+
`Circumference = ${circumference(radius).toFixed(5)} units`;
30753075
});
30763076
</script>
30773077
</div>
@@ -3290,25 +3290,25 @@ <h3 itemprop="name" style="margin:7px">Calculate the Area of a Circle Segment</h
32903290
let userEntered = { h: false, l: false, r: false };
32913291

32923292
function segmentArea() {
3293-
const hInput = document.getElementById('segment-height');
3294-
const lInput = document.getElementById('chord-length');
3295-
const rInput = document.getElementById('parent-radius');
3293+
const height = document.getElementById('segment-height');
3294+
const chordLength = document.getElementById('chord-length');
3295+
const radius = document.getElementById('parent-radius');
32963296
const output = document.getElementById('segment-area');
32973297

32983298
const activeElement = document.activeElement;
32993299
if (activeElement.id === "segment-height") userEntered.h = true;
33003300
if (activeElement.id === "chord-length") userEntered.l = true;
33013301
if (activeElement.id === "parent-radius") userEntered.r = true;
33023302

3303-
let h = parseFloat(hInput.value);
3304-
let l = parseFloat(lInput.value);
3305-
let r = parseFloat(rInput.value);
3303+
let h = parseFloat(height.value);
3304+
let l = parseFloat(chordLength.value);
3305+
let r = parseFloat(radius.value);
33063306

33073307
// Reset if user edits the auto-filled field
33083308
if (autoFilledField && activeElement.id === autoFilledField) {
3309-
hInput.value = "";
3310-
lInput.value = "";
3311-
rInput.value = "";
3309+
height.value = "";
3310+
chordLength.value = "";
3311+
radius.value = "";
33123312
output.innerText = "";
33133313
autoFilledField = null;
33143314
userEntered = { h: false, l: false, r: false };
@@ -4548,17 +4548,17 @@ <h4 itemprop="description" style="margin:12px">The volume of a pyramid can be ca
45484548

45494549
function updatePyramidVolume() {
45504550
const number = parseFloat(document.getElementById('pyramid-side-number').value);
4551-
const baseEdge = parseFloat(document.getElementById('pyramid-base-edge-length').value);
4551+
const baseLength = parseFloat(document.getElementById('pyramid-base-edge-length').value);
45524552
const height = parseFloat(document.getElementById('pyramid-height').value);
45534553

4554-
if (isNaN(number) || isNaN(baseEdge) || isNaN(height)) {
4554+
if (isNaN(number) || isNaN(baseLength) || isNaN(height)) {
45554555
document.getElementById('pyramid-volume').innerText = '';
45564556
return;
45574557
}
45584558

45594559
const ratio = 3.2 / number;
45604560
const tangent = tan(ratio);
4561-
const baseArea = (number / 4) * (baseEdge ** 2) / tangent;
4561+
const baseArea = (number / 4) * (baseLength ** 2) / tangent;
45624562
const volume = pyramidVolume(baseArea, height);
45634563

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

0 commit comments

Comments
 (0)