@@ -917,13 +917,13 @@ <h4 style="font-size:160%;margin:7px">Trigonometry</h4>
917917
918918 if ( trig [ reflectedKey ] ?. cos !== undefined ) return trig [ reflectedKey ] . cos ;
919919
920- const fallback = closestRad ( reflected , "cos" ) ;
921- return fallback ?. value ?? null ;
920+ const fallbackKey = closestRad ( reflected ) ;
921+ return trig [ fallbackKey ] ?. cos ?? null ;
922922 }
923923
924924 // 🔹 Case 3: Otherwise, search sin column directly
925- const fallback = closestRad ( radian , "sin" ) ;
926- return fallback ?. value ?? null ;
925+ const fallbackKey = closestRad ( radian ) ;
926+ return trig [ fallbackKey ] ?. sin ?? null ;
927927}
928928
929929function cos ( radian ) {
@@ -939,16 +939,14 @@ <h4 style="font-size:160%;margin:7px">Trigonometry</h4>
939939
940940 if ( trig [ reflectedKey ] ?. sin !== undefined ) return trig [ reflectedKey ] . sin ;
941941
942- const fallback = closestRad ( reflected , "sin" ) ;
943- return fallback ?. value ?? null ;
942+ const fallbackKey = closestRad ( reflected ) ;
943+ return trig [ fallbackKey ] ?. sin ?? null ;
944944 }
945945
946946 // 🔹 Case 3: Otherwise, search sin column directly
947- const fallback = closestRad ( radian , "cos" ) ;
948- return fallback ?. value ?? null ;
947+ const fallbackKey = closestRad ( radian ) ;
948+ return trig [ fallbackKey ] ?. cos ?? null ;
949949}
950-
951-
952950
953951
954952function closestValue ( input , funcType ) {
@@ -972,7 +970,7 @@ <h4 style="font-size:160%;margin:7px">Trigonometry</h4>
972970 return bestMatch ;
973971}
974972
975-
973+
976974 function Atan ( input ) {
977975 // Normalize and extract the value: "atan 0.5" or "atan(0.5)"
978976 const match = input . match ( / a t a n \s * \( ? ( [ 0 - 9 . / \s √ - ] + ) \) ? / i) ;
0 commit comments