@@ -2237,31 +2237,38 @@ <h6 style="font-size:160%;margin:7px">Area of a circle</h6>
22372237< br >
22382238< br >
22392239< h18 style ="margin-top:24px; "> Test section</ h18 >
2240- < label for ="atan-input "> Enter value (e.g. 2):</ label >
2241- < input type ="number " id ="atan-input " value ="2 " step ="any " style ="margin:8px; " />
2242- < button onclick ="testQueryAtan() "> Run Test</ button >
22432240
2244- < pre id ="atan-output " style ="padding:12px; background:#eee; "> </ pre >
2241+ < button onclick ="inspectTrig() "> Inspect Trig</ button >
2242+
2243+ < pre id ="trig-output " style ="padding:12px; background:#eee; margin-top:12px; "> </ pre >
22452244
22462245< script >
2247- function testQueryAtan ( ) {
2248- const input = parseFloat ( document . getElementById ( 'atan-input' ) . value ) ;
2249- const output = document . getElementById ( 'atan-output' ) ;
2246+ function inspectTrig ( ) {
2247+ const output = document . getElementById ( 'trig-output' ) ;
22502248 output . innerText = '' ;
22512249
2252- if ( isNaN ( input ) ) {
2253- output . innerText = 'Invalid input .' ;
2250+ if ( typeof trig !== 'object' ) {
2251+ output . innerText = '⚠️ Trig object not defined or not accessible .' ;
22542252 return ;
22552253 }
22562254
2257- try {
2258- const match = findClosestValueMatch ( input , 'tan' ) ; // your engine function
2259- output . innerText += `🔍 Looking for tan ≈ ${ input } \n\n` ;
2260- output . innerText += `🗝️ Best match key: ${ match . angle } \n` ;
2261- output . innerText += `📐 Approximated tan: ${ match . approx } \n` ;
2262- } catch ( err ) {
2263- output . innerText = '⚠️ Error during query:\n' + err . message ;
2255+ const keys = Object . keys ( trig ) ;
2256+ if ( keys . length === 0 ) {
2257+ output . innerText = '⚠️ Trig dataset is empty.' ;
2258+ return ;
22642259 }
2260+
2261+ output . innerText += `✅ Trig dataset loaded.\n\nKeys found:\n` ;
2262+
2263+ keys . forEach ( key => {
2264+ const entry = trig [ key ] ;
2265+ const sin = entry . sin ?? '⛔ not defined' ;
2266+ const tan = entry . tan ?? '⛔ not defined' ;
2267+
2268+ output . innerText += `• ${ key } \n` ;
2269+ output . innerText += ` sin: ${ typeof sin === 'object' ? JSON . stringify ( sin ) : sin } \n` ;
2270+ output . innerText += ` tan: ${ typeof tan === 'object' ? JSON . stringify ( tan ) : tan } \n\n` ;
2271+ } ) ;
22652272 }
22662273</ script >
22672274< footer >
0 commit comments