Skip to content

Commit

Permalink
SQRT3 재정의
Browse files Browse the repository at this point in the history
  • Loading branch information
usbsync committed Nov 21, 2024
1 parent 7f56060 commit d1d82ee
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions src/util/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1431,62 +1431,64 @@ Entry.toDegrees = function (radians) {
return (radians * 180) / Math.PI;
};

const SQRT3 = Math.sqrt(3);

const TRIG_VALUES = {
sin: {
0: 0,
30: 0.5,
45: Math.SQRT2 / 2,
60: Math.SQRT3 / 2,
60: SQRT3 / 2,
90: 1,
120: Math.SQRT3 / 2,
120: SQRT3 / 2,
135: Math.SQRT2 / 2,
150: 0.5,
180: 0,
210: -0.5,
225: -Math.SQRT2 / 2,
240: -Math.SQRT3 / 2,
240: -SQRT3 / 2,
270: -1,
300: -Math.SQRT3 / 2,
300: -SQRT3 / 2,
315: -Math.SQRT2 / 2,
330: -0.5,
360: 0,
},
cos: {
0: 1,
30: Math.SQRT3 / 2,
30: SQRT3 / 2,
45: Math.SQRT2 / 2,
60: 0.5,
90: 0,
120: -0.5,
135: -Math.SQRT2 / 2,
150: -Math.SQRT3 / 2,
150: -SQRT3 / 2,
180: -1,
210: -Math.SQRT3 / 2,
210: -SQRT3 / 2,
225: -Math.SQRT2 / 2,
240: -0.5,
270: 0,
300: 0.5,
315: Math.SQRT2 / 2,
330: Math.SQRT3 / 2,
330: SQRT3 / 2,
360: 1,
},
tan: {
0: 0,
30: Math.sqrt(3) / 3,
30: SQRT3 / 3,
45: 1,
60: Math.sqrt(3),
60: SQRT3,
90: Infinity,
120: -Math.sqrt(3),
120: -SQRT3,
135: -1,
150: -Math.sqrt(3) / 3,
150: -SQRT3 / 3,
180: 0,
210: Math.sqrt(3) / 3,
210: SQRT3 / 3,
225: 1,
240: Math.sqrt(3),
240: SQRT3,
270: -Infinity,
300: -Math.sqrt(3),
300: -SQRT3,
315: -1,
330: -Math.sqrt(3) / 3,
330: -SQRT3 / 3,
360: 0,
},
};
Expand Down

0 comments on commit d1d82ee

Please sign in to comment.