Skip to content

Commit d79ea10

Browse files
authored
Update index.html
1 parent 88388d7 commit d79ea10

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

index.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3105,16 +3105,21 @@ <h3 itemprop="eduQuestionType" style="margin:7px">Area of a Circle Segment</h3>
31053105
output.innerText = "The chord length must be at least twice the height.";
31063106
return;
31073107
}
3108-
if (l / h > 30) {
3109-
output.innerText = "Out of range: chord-to-height ratio exceeds 30.";
3108+
if (l / h > 11) {
3109+
output.innerText = "Out of range: chord-to-height ratio exceeds 11.";
31103110
return;
31113111
}
31123112

31133113
// Unified area calculation
31143114
let angle = Acos((r - h) / r);
31153115
let area = angle * r ** 2 - (r - h) * (l / 2);
31163116

3117-
if (h === r || h === l / 2 || l === 2 * r) {
3117+
if (isNaN(area)){
3118+
output.innerText = "";
3119+
return;
3120+
}
3121+
3122+
if (h === r || h === l / 2 || l === 2 * r) {
31183123
output.innerText = `Semicircle area: ${area.toFixed(5)} square units`;
31193124
} else {
31203125
output.innerText = `Area: ${area.toFixed(5)} square units`;

0 commit comments

Comments
 (0)