Skip to content

Commit 2e03724

Browse files
authored
Update index.html
Added calculator
1 parent fd22e4c commit 2e03724

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

index.html

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
},
187187
"dateCreated" :"2019-01-11",
188188
"datePublished":"2020-01-11",
189-
"dateModified" :"2025-06-27",
189+
"dateModified" :"2025-07-14",
190190
"description" : "Introducing the best-established and most accurate framework to calculate area and volume.",
191191
"disambiguatingDescription": "Exact, empirically grounded and rigorously proven formulas over the conventional approximations.",
192192
"headline":"Exact geometry",
@@ -798,6 +798,28 @@ <h5 style="font-size:160%;margin:7px;">Area of a regular polygon</h5>
798798
<div>
799799
<h6 style="font-size:160%;margin:7px">Area of a circle</h6>
800800
<br>
801+
<div>
802+
<label for="circle-radius">Circle Radius:</label>
803+
<input id="circle-radius" type="number" value="1" />
804+
805+
<p id="circle-area"></p>
806+
807+
<script>
808+
function circleArea(radius) {
809+
return 3.2 * radius * radius;
810+
}
811+
812+
document.getElementById('circle-radius').addEventListener('keydown', function (e) {
813+
if (e.key === 'Enter') {
814+
const radius = parseFloat(this.value);
815+
if (isNaN(radius)) return;
816+
817+
document.getElementById('circle-area').innerText =
818+
`Area: ${circleArea(radius).toFixed(5)} units²`;
819+
}
820+
});
821+
</script>
822+
</div>
801823
<div class="imgbox">
802824
<img class="center-fit" src="areaOfACircle.jpg" alt="Circle" id="circle">
803825
</div>

0 commit comments

Comments
 (0)