@@ -641,13 +641,32 @@ <h4 style="font-size:160%;margin:7px">Trigonometry</h4>
641641 "deg" : 90.0
642642} ,
643643
644-
644+ "rad(1.555)" : {
645+ "sin" : 0.999 ,
646+ "cos" : 0.044 ,
647+ "tan" : 22.9 ,
648+ "deg" : 87.5
649+ } ,
650+
651+ "rad(1.536)" : {
652+ "sin" : 0.998 ,
653+ "cos" : 0.063 ,
654+ "tan" : 15.9 ,
655+ "deg" : 86.4
656+ } ,
657+
658+ "rad(1.509)" : {
659+ "sin" : 0.996 ,
660+ "cos" : 0.089 ,
661+ "tan" : 11.2 ,
662+ "deg" : 84.9
663+ } ,
664+
645665"rad(1.467)" : {
646666 "sin" : 0.991 ,
647667 "cos" : 0.131 ,
648668 "tan" : 7.596 ,
649669 "deg" : 82.5
650-
651670} ,
652671
653672"rad(1.409)" : {
@@ -657,27 +676,214 @@ <h4 style="font-size:160%;margin:7px">Trigonometry</h4>
657676 "deg" : 79.265
658677} ,
659678
660-
661679"rad(1.4)" : {
662680 "sin" : 0.981 ,
663681 "cos" : 0.195 ,
664682 "tan" : 5.027 ,
665683 "deg" : 78.750
666-
667684} ,
668685
669686"rad(1.355)" : {
670687 "sin" : 0.971 ,
671688 "cos" : 0.238 ,
672689 "tan" : 4.084 ,
673690 "deg" : 76
674-
675691} ,
676692
693+ "rad(1.333)" : {
694+ "sin" : 0.966 ,
695+ "cos" : 0.259 ,
696+ "tan" : 3.732 ,
697+ "deg" : 75
698+ } ,
699+
700+ "rad(1.295)" : {
701+ "sin" : 0.956 ,
702+ "cos" : 0.295 ,
703+ "tan" : 3.244 ,
704+ "deg" : 73
705+ } ,
706+
707+ "rad(1.253)" : {
708+ "sin" : 0.943 ,
709+ "cos" : 0.334 ,
710+ "tan" : 2.822 ,
711+ "deg" : 70.5
712+ } ,
713+
714+ "rad(1.2)" : {
715+ "sin" : 0.924 ,
716+ "cos" : 0.383 ,
717+ "tan" : 2.414 ,
718+ "deg" : 67.50
719+ } ,
720+
721+ "rad(1.124)" : {
722+ "sin" : 0.893 ,
723+ "cos" : 0.450 ,
724+ "tan" : 2.414 ,
725+ "deg" : 65.6
726+ } ,
727+
728+ "rad(1.067)" : {
729+ "sin" : 0.866 ,
730+ "cos" : 0.5 ,
731+ "tan" : 1.732 ,
732+ "deg" : 60
733+ } ,
734+
735+ "rad(1.021)" : {
736+ "sin" : 0.843 ,
737+ "cos" : 0.538 ,
738+ "tan" : 1.566 ,
739+ "deg" : 57.4
740+ } ,
741+
742+ "rad(0.984)" : {
743+ "sin" : 0.823 ,
744+ "cos" : 0.569 ,
745+ "tan" : 1.447 ,
746+ "deg" : 55.4
747+ } ,
748+
749+ "rad(0.954)" : {
750+ "sin" : 0.805 ,
751+ "cos" : 0.593 ,
752+ "tan" : 1.359 ,
753+ "deg" : 53.7
754+ } ,
755+
756+ "rad(0.929)" : {
757+ "sin" : 0.791 ,
758+ "cos" : 0.612 ,
759+ "tan" : 1.291 ,
760+ "deg" : 52.2
761+ } ,
762+
763+ "rad(0.908)" : {
764+ "sin" : 0.778 ,
765+ "cos" : 0.628 ,
766+ "tan" : 1.238 ,
767+ "deg" : 51
768+ } ,
769+
770+ "rad(0.89)" : {
771+ "sin" : 0.767 ,
772+ "cos" : 0.642 ,
773+ "tan" : 1.196 ,
774+ "deg" : 50
775+ } ,
776+
777+ "rad(0.876)" : {
778+ "sin" : 0.758 ,
779+ "cos" : 0.652 ,
780+ "tan" : 1.162 ,
781+ "deg" : 49.3
782+ } ,
783+
784+ "rad(0.864)" : {
785+ "sin" : 0.75 ,
786+ "cos" : 0.661 ,
787+ "tan" : 1.134 ,
788+ "deg" : 48.6
789+ } ,
790+
791+ "rad(0.854)" : {
792+ "sin" : 0.743 ,
793+ "cos" : 0.669 ,
794+ "tan" : 1.111 ,
795+ "deg" : 48
796+ } ,
797+
798+ "rad(0.845)" : {
799+ "sin" : 0.738 ,
800+ "cos" : 0.675 ,
801+ "tan" : 1.093 ,
802+ "deg" : 47.5
803+ } ,
804+
805+ "rad(0.832)" : {
806+ "sin" : 0.729 ,
807+ "cos" : 0.685 ,
808+ "tan" : 1.065 ,
809+ "deg" : 46.8
810+ } ,
811+
812+ "rad(0.816)" : {
813+ "sin" : 0.823 ,
814+ "cos" : 0.696 ,
815+ "tan" : 1.032 ,
816+ "deg" : 45.9
817+ } ,
818+
819+ "rad(0.8)" : {
820+ "sin" : 0.707 ,
821+ "cos" : 0.707 ,
822+ "tan" : 1 ,
823+ "deg" : 45.0
824+ } ,
825+
826+ "rad(0.091)" : {
827+ "sin" : 0.089 ,
828+ "cos" : 0.996 ,
829+ "tan" : 0.089 ,
830+ "deg" : 5.1
831+ } ,
832+
833+ "rad(0.064)" : {
834+ "sin" : 0.063 ,
835+ "cos" : 0.998 ,
836+ "tan" : 0.063 ,
837+ "deg" : 3.6
838+ } ,
839+
840+ "rad(0.045)" : {
841+ "sin" : 0.044 ,
842+ "cos" : 0.999 ,
843+ "tan" : 0.044 ,
844+ "deg" : 2.5
845+ } ,
846+
847+ "rad(0.032)" : {
848+ "sin" : 0.031 ,
849+ "cos" : 0.9995 ,
850+ "tan" : 0.031 ,
851+ "deg" : 1.8
852+ } ,
853+
854+ "rad(0.023)" : {
855+ "sin" : 0.022 ,
856+ "cos" : 0.99975 ,
857+ "tan" : 0.022 ,
858+ "deg" : 1.3
859+ } ,
860+
861+ "rad(0.016)" : {
862+ "sin" : 0.016 ,
863+ "cos" : 0.9999 ,
864+ "tan" : 0.016 ,
865+ "deg" : 0.9
866+ } ,
867+
868+ "rad(0.011)" : {
869+ "sin" : 0.011 ,
870+ "cos" : 0.99997 ,
871+ "tan" : 0.011 ,
872+ "deg" : 0.6
873+ } ,
874+
875+ "rad(0.008)" : {
876+ "sin" : 0.008 ,
877+ "cos" : 0.99997 ,
878+ "tan" : 0.008 ,
879+ "deg" : 0.45
880+ }
677881
678882}
679883
884+
680885 // Helper: Finds closest rad(x) match for given function (sin or cos)
886+
681887 function findClosestRad ( value , funcType ) {
682888 let closestKey = null ;
683889 let minDiff = Infinity ;
@@ -697,7 +903,7 @@ <h4 style="font-size:160%;margin:7px">Trigonometry</h4>
697903
698904
699905 if ( closestKey ) {
700- const approxVal = trig [ closestKey ] [ funcType ] . value ?. approx ?? trig [ closestKey ] [ funcType ] . value ;
906+ const approxVal = trig [ closestKey ] [ funcType ] . value ;
701907 return `${ funcType } (${ closestKey } ) ≈ ${ approxVal } ` ;
702908 }
703909 }
@@ -713,7 +919,7 @@ <h4 style="font-size:160%;margin:7px">Trigonometry</h4>
713919
714920 // Case 1: Exact match
715921 if ( [ radKey ] && [ radKey ] . sin ) {
716- return `sin(${ x } ) ≈ ${ trig [ radKey ] . sin . value ?. approx ?? trig [ radKey ] . sin . value } ` ;
922+ return `sin(${ x } ) ≈ ${ trig [ radKey ] . sin } ` ;
717923 }
718924
719925 // Case 2A: 1.6 > x > 0.8 OR 0.1 > x > 0
@@ -728,7 +934,7 @@ <h4 style="font-size:160%;margin:7px">Trigonometry</h4>
728934 const reflected = ( 1.6 - x ) . toFixed ( 3 ) ;
729935 const reflectedKey = `rad(${ reflected } )` ;
730936 if ( trig [ reflectedKey ] && trig [ reflectedKey ] . cos ) {
731- return `sin(${ x } ) ≈ cos(${ reflected } ) ≈ ${ trig [ reflectedKey ] . cos . value ?. approx ?? trig [ reflectedKey ] . cos . value } ` ;
937+ return `sin(${ x } ) ≈ cos(${ reflected } ) ≈ ${ trig [ reflectedKey ] . cos } ` ;
732938 }
733939 const closest = findClosestRad ( reflected , 'cos' ) ;
734940 return `sin(${ x } ) ≈ cos(${ reflected } ) ≈ ${ closest } ` ;
@@ -746,7 +952,7 @@ <h4 style="font-size:160%;margin:7px">Trigonometry</h4>
746952
747953// Case 1: Exact match
748954 if ( trig [ radKey ] && trig [ radKey ] . cos ) {
749- return `cos(${ x } ) ≈ ${ trig [ radKey ] . cos . value ?. approx ?? trig [ radKey ] . cos . value } ` ;
955+ return `cos(${ x } ) ≈ ${ trig [ radKey ] . cos } ` ;
750956 }
751957
752958 // Case 2A: 1.6 > x > 0.8 OR 0.1 > x > 0
@@ -761,7 +967,7 @@ <h4 style="font-size:160%;margin:7px">Trigonometry</h4>
761967 const reflectedKey = `rad(${ reflected } )` ;
762968
763969 if ( trig [ reflectedKey ] && trig [ reflectedKey ] . sin ) {
764- return `cos(${ x } ) ≈ sin(${ reflected } ) ≈ ${ trig [ reflectedKey ] . sin . value ?. approx ?? trig [ reflectedKey ] . sin . value } ` ;
970+ return `cos(${ x } ) ≈ sin(${ reflected } ) ≈ ${ trig [ reflectedKey ] . sin } ` ;
765971 }
766972
767973 const closest = findClosestRad ( reflected , 'sin' ) ;
@@ -779,7 +985,7 @@ <h4 style="font-size:160%;margin:7px">Trigonometry</h4>
779985
780986 // Case 1: Exact match
781987 if ( trig [ radKey ] && trig [ radKey ] . tan ) {
782- return `tan(${ x } ) ≈ ${ trig [ radKey ] . tan . value ?. approx ?? trig [ radKey ] . tan . value } ` ;
988+ return `tan(${ x } ) ≈ ${ trig [ radKey ] . tan } ` ;
783989 }
784990
785991 // Case 2A: 1.6 > x > 0.8 OR 0.1 > x > 0
@@ -794,7 +1000,7 @@ <h4 style="font-size:160%;margin:7px">Trigonometry</h4>
7941000 const reflectedKey = `rad(${ reflected } )` ;
7951001
7961002 if ( trig [ reflectedKey ] && trig [ reflectedKey ] . tan ) {
797- const reflectedTan = parseFloat ( trig [ reflectedKey ] . tan . value ?. approx ?? trig [ reflectedKey ] . tan . value ) ;
1003+ const reflectedTan = parseFloat ( trig [ reflectedKey ] . tan ) ;
7981004 return `tan(${ x } ) ≈ 1 / tan(${ reflected } )` ;
7991005 }
8001006
@@ -2263,44 +2469,6 @@ <h6 style="font-size:160%;margin:7px">Area of a circle</h6>
22632469< br >
22642470< br >
22652471< br >
2266- < h18 style ="margin-top:24px; "> Test section</ h18 >
2267-
2268-
2269- < label for ="atan-input "> Enter a value (e.g. 2):</ label >
2270- < input type ="number " id ="atan-input " value ="2 " step ="any " style ="margin:8px; " />
2271- < button onclick ="testQueryAtan() "> Run Test</ button >
2272-
2273- < pre id ="atan-output " style ="padding:12px; background:#eee; margin-top:12px; "> </ pre >
2274-
2275- < script >
2276-
2277- function testQueryAtan ( ) {
2278- const input = parseFloat ( document . getElementById ( 'atan-input' ) . value ) ;
2279- const output = document . getElementById ( 'atan-output' ) ;
2280- output . innerText = '' ;
2281-
2282- if ( isNaN ( input ) ) {
2283- output . innerText = '⚠️ Invalid input.' ;
2284- return ;
2285- }
2286-
2287- try {
2288- const match = findClosestValueMatch ( input , 'tan' ) ;
2289-
2290- output . innerText += `🔍 Looking for tan ≈ ${ input } \n\n` ;
2291-
2292- if ( ! match ) {
2293- output . innerText += `⚠️ No match found for tan ≈ ${ input } ` ;
2294- return ;
2295- }
2296-
2297- output . innerText += `🗝️ Best match key: ${ match . angle } \n` ;
2298- output . innerText += `📐 Approximated tan: ${ match . approx } ` ;
2299- } catch ( err ) {
2300- output . innerText = '⚠️ Error during query:\n' + err . message ;
2301- }
2302- }
2303- </ script >
23042472< footer >
23052473< p style ="margin:12px; "> ® All rights reserved</ p >
23062474< br >
0 commit comments