@@ -2508,6 +2508,52 @@ <h6 style="font-size:160%;margin:7px">Area of a circle</h6>
25082508< br >
25092509< br >
25102510< br >
2511+ < h18 style ="margin-top:24px; "> 🧪 CGS Trig Test Tool</ h18 >
2512+
2513+ < label for ="input-angle "> Angle (rad):</ label >
2514+ < input id ="input-angle " type ="text " value ="rad(1.467) " style ="margin:8px; " />
2515+ < br >
2516+
2517+ < label for ="input-value "> Value (e.g. 0.991):</ label >
2518+ < input id ="input-value " type ="number " step ="any " value ="0.991 " style ="margin:8px; " />
2519+ < br >
2520+ < button onclick ="runTrigTests() "> Run Tests</ button >
2521+
2522+ < pre id ="trig-output " style ="padding:12px; background:#eee; margin-top:12px; "> </ pre >
2523+
2524+ < script >
2525+
2526+
2527+ function runTrigTests ( ) {
2528+ const angleInput = document . getElementById ( "input-angle" ) . value ;
2529+ const valueInput = parseFloat ( document . getElementById ( "input-value" ) . value ) ;
2530+ const output = document . getElementById ( "trig-output" ) ;
2531+ output . innerText = "" ;
2532+
2533+ // Regular trig
2534+ const trigEntry = trig [ angleInput ] ;
2535+ if ( ! trigEntry ) {
2536+ output . innerText += `⚠️ No entry found for ${ angleInput } \n` ;
2537+ } else {
2538+ output . innerText += `✅ Found trig entry for ${ angleInput } \n` ;
2539+ output . innerText += `• sin: ${ trigEntry . sin } \n` ;
2540+ output . innerText += `• cos: ${ trigEntry . cos } \n` ;
2541+ output . innerText += `• tan: ${ trigEntry . tan } \n\n` ;
2542+ }
2543+
2544+ // Inverse trig
2545+ output . innerText += `🔍 Searching inverse matches for ≈ ${ valueInput } \n\n` ;
2546+
2547+ [ "sin" , "cos" , "tan" ] . forEach ( func => {
2548+ const match = findClosestValueMatch ( valueInput , func ) ;
2549+ if ( match ) {
2550+ output . innerText += `atan⟶${ func } : ${ valueInput } → ${ match . angle } [${ func } =${ match . value } ]\n` ;
2551+ } else {
2552+ output . innerText += `atan⟶${ func } : No match found for ${ valueInput } \n` ;
2553+ }
2554+ } ) ;
2555+ }
2556+ </ script >
25112557< footer >
25122558< p style ="margin:12px; "> ® All rights reserved</ p >
25132559< br >
0 commit comments