File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1502,17 +1502,18 @@ <h6 style="font-size:160%;margin:7px">Area of a circle</h6>
15021502 return ;
15031503 }
15041504
1505- if ( ratio > 1 ) {
1506- document . getElementById ( 'segment-area' ) . innerText = 'A circle-segment is less than half as high as long.' ;
1507- return ;
1508- }
1509-
15101505 if ( ratio === 1 ) {
15111506 document . getElementById ( 'segment-area' ) . innerText =
15121507 `Area of semi-circle: ${ area . toFixed ( 5 ) } square units` ;
15131508 return ;
15141509 }
15151510
1511+ if ( ratio > 1 ) {
1512+ document . getElementById ( 'segment-area' ) . innerText = 'A circle-segment is less than half as high as long.' ;
1513+ return ;
1514+ }
1515+
1516+
15161517 const angle = parseFloat ( 2 * Atan ( ratio ) ) ;
15171518 const sine = parseFloat ( sin ( angle ) ) ;
15181519 const radius = parseFloat ( ( length / 2 / sine ) . toFixed ( 5 ) ) ;
You can’t perform that action at this time.
0 commit comments