Game Maths Flashcards
A radian is equivalent to approx how many degrees?
57.2958 degrees
How many radians in a circle?
6.2832
In pi - what does 360 degrees equal?
2 PI
in pi - what does 180 degrees equal?
PI
In pi - what does 90 degrees equal?
PI / 2
What is a JavaScript formula for converting degrees to radians?
radians = degrees * Math.PI / 180;
What is a JavaScript formula for converting radians to degrees?
degrees = radians * 180 / Math.PI;
The opposite side to an angle…
does not touch the angle
The adjacent side to an angle…
touches the angle (and is not the hypotenuse)
The sine of an angle is…
the ratio of the lengths of the side opposite the angle and the hypotenuse
opposite side / hypotenuse
When you use Math.sin, the result may not be what you expect - what step do you have to make to make this make sense?
convert the angle to radians
What do you need to remember about angles in JavaScript?
The coordinate system is reversed due to the origin being in the top / left corner. So the positive direction is clockwise, rather than counter-clockwise as in standard maths.
0 Degrees is still in the positive X direction though.
What is the cosine of an angle defined as?
Ratio of the adjacent leg of an angle to the Hypotenuse
adjacent leg / hypotenuse
You need to find out the cosine of an angle 30 degrees - how would you do that?
Math.cos(30 * Math.PI / 180)
NOTE: We have to convert to radians first!
You need to find out the sine of an angle 30 degrees, how would you do that?
Math.sin(30 * Math.PI / 180)
NOTE: We have to convert to radians first!