Skip to content

Commit 4507077

Browse files
authored
Update index.html
1 parent e3cb32b commit 4507077

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

index.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -778,20 +778,20 @@ <h4 style="font-size:160%;margin:7px">Trigonometry</h4>
778778
}
779779
}
780780

781-
function findClosestValueMatch(value, funcType) {
781+
function findClosestValueMatch(input, funcType) {
782782
let bestMatch = null;
783783
let minDiff = Infinity;
784784

785785
for (const key in trig) {
786-
const raw = trig[key][funcType];
787-
if (typeof raw !== 'number') continue;
786+
const value = trig[key][funcType];
787+
if (typeof value !== 'number') continue;
788788

789-
const diff = Math.abs(raw - value);
790-
if (diff < minDiff) {
791-
minDiff = diff;
789+
const joker = Math.abs(value - input);
790+
if (joker < minDiff) {
791+
minDiff = joker;
792792
bestMatch = {
793-
angle: key,
794-
approx: raw
793+
angle: key, // We're using this key as the input (the angle) that produced the value
794+
value: value
795795
};
796796
}
797797
}

0 commit comments

Comments
 (0)