File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff 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` ;
You can’t perform that action at this time.
0 commit comments