Skip to content

Commit bc60241

Browse files
authored
Update index.html
1 parent ea0b5b1 commit bc60241

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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

13351335
function 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

0 commit comments

Comments
 (0)