Skip to content

Commit 82fcf24

Browse files
authored
Update index.html
1 parent 0fda3c1 commit 82fcf24

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

index.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3076,8 +3076,8 @@ <h3 itemprop="eduQuestionType" style="margin:7px">Area of a Circle Segment</h3>
30763076

30773077
// Derive missing field
30783078
if (!isNaN(h) && !isNaN(r) && isNaN(l)) {
3079-
let angle = Math.acos((r - h) / r);
3080-
l = 2 * r * Math.sin(angle);
3079+
let angle = Acos((r - h) / r);
3080+
l = 2 * r * sin(angle);
30813081
lInput.value = l.toFixed(5);
30823082
autoFilledField = "chord-length";
30833083
}
@@ -3095,16 +3095,17 @@ <h3 itemprop="eduQuestionType" style="margin:7px">Area of a Circle Segment</h3>
30953095
// Validity check
30963096
if (h > r || l < 2 * h || r < h) {
30973097
output.innerText = "Invalid: must satisfy h ≤ r, l ≥ 2h, r ≥ h.";
3098-
return; // keep listening, no lock
3098+
return;
30993099
}
31003100

31013101
// Compute area
3102-
let angle = Math.acos((r - h) / r);
3102+
let angle = Acos((r - h) / r);
31033103
let area = angle * r ** 2 - (r - h) * (l / 2);
31043104

31053105
// Output
31063106
if (h === r || h === l / 2 || l === 2 * r) {
31073107
output.innerText = `Semicircle area: ${area.toFixed(5)} square units`;
3108+
return;
31083109
} else {
31093110
output.innerText = `Area: ${area.toFixed(5)} square units`;
31103111
}

0 commit comments

Comments
 (0)