Skip to content

Commit 7428b1e

Browse files
authored
Update index.html
1 parent 3546916 commit 7428b1e

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3095,18 +3095,18 @@ <h3 itemprop="eduQuestionType" style="margin:7px">Area of a Circle Segment</h3>
30953095
autoFilledField = "segment-height";
30963096
}
30973097

3098-
// Validity checks
3099-
if (h > r || l < 2 * h || r < h) {
3100-
document.getElementById('segment-area').innerText =
3101-
'Invalid: must satisfy h ≤ r, l ≥ 2h, r ≥ h.';
3102-
// ❌ no return here — keep listening for further input
3103-
} else {
31043098
// Compute angle and area
31053099
let angle = Acos((r - h) / r);
31063100
let area = angle * r ** 2 - (r - h) * (l / 2);
31073101

31083102
// Output with semicircle reminders
3109-
if (h === r || h === l / 2 || l === 2 * r) {
3103+
// Validity checks
3104+
if (h > r || l < 2 * h || r < h) {
3105+
document.getElementById('segment-area').innerText =
3106+
'Invalid: must satisfy h ≤ r, l ≥ 2h, r ≥ h.';
3107+
// no return here — keep listening for further input
3108+
} else {
3109+
if (h === r || h === l / 2 || l === 2 * r) {
31103110
document.getElementById('segment-area').innerText =
31113111
`Semicircle area: ${area.toFixed(5)} square units`;
31123112
} else {

0 commit comments

Comments
 (0)