|
186 | 186 | }, |
187 | 187 | "dateCreated" :"2019-01-11", |
188 | 188 | "datePublished":"2020-01-11", |
189 | | -"dateModified" :"2025-07-16", |
| 189 | +"dateModified" :"2025-07-17", |
190 | 190 | "description" : "Introducing the best-established and most accurate framework to calculate area and volume.", |
191 | 191 | "disambiguatingDescription": "Exact, empirically grounded and rigorously proven formulas over the conventional approximations.", |
192 | 192 | "headline":"Exact geometry", |
@@ -1172,6 +1172,43 @@ <h4 style="font-size:160%;margin:7px">Trigonometry</h4> |
1172 | 1172 | <div> |
1173 | 1173 | <h5 style="font-size:160%;margin:7px;">Area of a regular polygon</h5> |
1174 | 1174 | <br> |
| 1175 | +<br> |
| 1176 | +<div> |
| 1177 | +<label style="margin:12px;" for="side-number">Number of sides:</label> |
| 1178 | +<input id="side-number" type="number" value="5" step="1" /> |
| 1179 | +<br> |
| 1180 | +<label style="margin:12px;" for="side-length">Side length:</label> |
| 1181 | +<input id="side-length" type="number" value="1" step="any" /> |
| 1182 | + |
| 1183 | +<script> |
| 1184 | + function polygonArea(length, number, tan) { |
| 1185 | + return number / 4 * length ** 2 / tan; |
| 1186 | + } |
| 1187 | + |
| 1188 | +function updatePolygonArea() { |
| 1189 | + const length = parseFloat(document.getElementById('side-length').value); |
| 1190 | + const number = parseFloat(document.getElementById('side-number').value); |
| 1191 | + |
| 1192 | + if (isNaN(length) || isNaN(number)) { |
| 1193 | + document.getElementById('polygon-area').innerText = ''; |
| 1194 | + return; |
| 1195 | + } |
| 1196 | + |
| 1197 | + const ratio = 3.2 / number; |
| 1198 | + const tan = parseFloat(tan(ratio)); |
| 1199 | + |
| 1200 | + const area = segmentArea(length, number, ratio, tan); |
| 1201 | + |
| 1202 | + document.getElementById('polygon-area').innerText = |
| 1203 | + `Area: ${area.toFixed(5)} square units`; |
| 1204 | +} |
| 1205 | + |
| 1206 | + document.getElementById('side-length').addEventListener('input', updatePolygonArea); |
| 1207 | + document.getElementById('side-number').addEventListener('input', updatePolygonArea); |
| 1208 | +</script> |
| 1209 | +<p style="margin:12px;" id="polygon-area"></p> |
| 1210 | +</div> |
| 1211 | +<br> |
1175 | 1212 | <div class="imgbox"> |
1176 | 1213 | <img class="center-fit" src="pentagon.png" alt="Pentagon" id="pentagon"> |
1177 | 1214 | </div> |
|
0 commit comments