File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1329,7 +1329,7 @@ <h6 style="font-size:160%;margin:7px">Area of a circle</h6>
13291329
13301330< script >
13311331 function segmentArea ( length , height , angle , radius ) {
1332- return 5 * angle * radius ** 2 - ( radius - height ) * length / 2 ;
1332+ return angle * radius ** 2 - ( radius - height ) * length / 2 ;
13331333 }
13341334
13351335function updateSegmentArea ( ) {
@@ -1342,9 +1342,9 @@ <h6 style="font-size:160%;margin:7px">Area of a circle</h6>
13421342 }
13431343
13441344 const thing = 2 * height / length ;
1345- const angle = parseFloat ( Atan ( thing ) . toFixed ( 5 ) ) ;
1346- const cosine = parseFloat ( cos ( angle ) . toFixed ( 5 ) ) ;
1347- const radius = length / ( 2 * cosine ) ;
1345+ const angle = parseFloat ( 2 * Atan ( thing ) . toFixed ( 5 ) ) ;
1346+ const sine = parseFloat ( sin ( angle ) . toFixed ( 5 ) ) ;
1347+ const radius = length / ( 2 * sine ) ;
13481348
13491349 const area = segmentArea ( length , height , angle , radius ) ;
13501350
You can’t perform that action at this time.
0 commit comments