Skip to content

Commit e1511ef

Browse files
authored
Update index.html
1 parent acd7cbe commit e1511ef

1 file changed

Lines changed: 43 additions & 9 deletions

File tree

index.html

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
"alternateName": "Exact Geometry",
108108
"accessMode" : "mathOnVisual" ,
109109
"accessibilityHazard" :"none" ,
110-
"accessibilitySummary" : "View videos, figures and read equations with explanation" ,
110+
"accessibilitySummary" : "View videos, figures and read equations with explanation. Online calculator." ,
111111
"accountablePerson" : {
112112
"@type" : "Person" ,
113113
"address": {
@@ -909,7 +909,7 @@ <h4 style="font-size:160%;margin:7px">Trigonometry</h4>
909909
}
910910
}
911911

912-
function querySin(input) {
912+
function sin(input) {
913913
// Normalize input: remove spaces, handle cases like "sin 0533" or "sin(0.533)"
914914
const match = input.match(/sin\s*\(?([0-9.]+)\)?/i);
915915
if (!match) return "Invalid input. Format: sin 0.533 or sin(0.533)";
@@ -942,7 +942,7 @@ <h4 style="font-size:160%;margin:7px">Trigonometry</h4>
942942

943943
}
944944

945-
function queryCos(input) {
945+
function cos(input) {
946946
// Normalize and extract the value from input like "cos 0.533" or "cos(0.533)"
947947
const match = input.match(/cos\s*\(?([0-9.]+)\)?/i);
948948
if (!match) return; // Invalid input format
@@ -975,7 +975,7 @@ <h4 style="font-size:160%;margin:7px">Trigonometry</h4>
975975
}
976976
}
977977

978-
function queryTan(input) {
978+
function tan(input) {
979979
// Normalize and extract the value from input like "tan 0.533" or "tan(0.533)"
980980
const match = input.match(/tan\s*\(?([0-9.]+)\)?/i);
981981
if (!match) return; // Invalid input format
@@ -1030,7 +1030,7 @@ <h4 style="font-size:160%;margin:7px">Trigonometry</h4>
10301030
return bestMatch;
10311031
}
10321032

1033-
function queryAsin(input) {
1033+
function Asin(input) {
10341034
// Normalize and extract the value: "asin 0.5" or "asin(0.5)"
10351035
const match = input.match(/asin\s*\(?([0-9./\s-]+)\)?/i);
10361036
if (!match) return; // Invalid format
@@ -1056,7 +1056,7 @@ <h4 style="font-size:160%;margin:7px">Trigonometry</h4>
10561056
}
10571057
}
10581058

1059-
function queryAcos(input) {
1059+
function Acos(input) {
10601060
// Normalize and extract the value: "acos 0.5" or "acos(0.5)"
10611061
const match = input.match(/acos\s*\(?([0-9./\s-]+)\)?/i);
10621062
if (!match) return; // Invalid format
@@ -1081,15 +1081,15 @@ <h4 style="font-size:160%;margin:7px">Trigonometry</h4>
10811081
}
10821082
}
10831083

1084-
function queryAtan(input) {
1084+
function Atan(input) {
10851085
// Normalize and extract the value: "atan 0.5" or "atan(0.5)"
10861086
const match = input.match(/atan\s*\(?([0-9./\s-]+)\)?/i);
10871087
if (!match) return; // Invalid format
10881088

10891089
const inputStr = match[1].trim();
10901090
const x = parseFloat(eval(inputStr.replace(/(\d+)/g, 'Math.sqrt($1)')));
10911091

1092-
if (isNaN(x) || x <= 0 || x >= 7.6) return; // Domain cutoffs from your spec
1092+
if (isNaN(x) || x <= 0 ) return; // Domain cutoffs from your spec
10931093

10941094
// Case A: x > 1 or x < 0.089 → direct match
10951095
if (x > 1 || x < 0.089) {
@@ -1408,6 +1408,40 @@ <h6 style="font-size:160%;margin:7px">Area of a circle</h6>
14081408
<div>
14091409
<h7 style="font-size:160%;margin:7px">Area of a circle segment</h7>
14101410
<br>
1411+
<br>
1412+
<div>
1413+
<label style="margin:12px;" for="segment-length">Length:</label>
1414+
<input id="segment-length" type="number" value="1" step="any" />
1415+
<br>
1416+
<label style="margin:12px;" for="segment-height">Height:</label>
1417+
<input id="segment-height" type="number" value="0.5" step="any" />
1418+
1419+
<script>
1420+
function segmentArea(length, height, angle, radius) {
1421+
return 5 * angle * radius ** 2 - (radius - height) * length / 2;
1422+
}
1423+
1424+
function updateSegmentArea() {
1425+
const length = parseFloat(document.getElementById('segment-length').value);
1426+
const height = parseFloat(document.getElementById('segment-height').value);
1427+
const angle = parseFloat(atan(2 * height / length).toFixed(5));
1428+
const cosine = parseFloat(cos(angle).toFixed(5));
1429+
const radius = length / 2 * cosine
1430+
if (isNaN(length) || isNaN(height)) {
1431+
document.getElementById('segment-area').innerText = '';
1432+
return;
1433+
}
1434+
1435+
document.getElementById('segment-area').innerText =
1436+
`Area: ${segmentArea(length, height).toFixed(5)} square units`;
1437+
}
1438+
1439+
document.getElementById('segment-length').addEventListener('input', updateSegmentArea);
1440+
document.getElementById('segment-height').addEventListener('input', updateSegmentArea);
1441+
</script>
1442+
<p style="margin:12px;" id="segment-area"></p>
1443+
</div>
1444+
<br>
14111445
<div class="imgbox">
14121446
<img class="center-fit" src="circleSegment.jpg" alt="Circle-segment" id="segment">
14131447
</div>
@@ -2150,7 +2184,7 @@ <h6 style="font-size:160%;margin:7px">Area of a circle</h6>
21502184
}
21512185

21522186
document.getElementById('cone-surface').innerText =
2153-
`Volume: ${coneSurface(radius, height).toFixed(5)} square units`;
2187+
`Area: ${coneSurface(radius, height).toFixed(5)} square units`;
21542188
}
21552189

21562190
document.getElementById('cone-radius-s').addEventListener('input', updateConeSurface);

0 commit comments

Comments
 (0)