Game Maths Flashcards

1
Q

A radian is equivalent to approx how many degrees?

A

57.2958 degrees

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How many radians in a circle?

A

6.2832

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

In pi - what does 360 degrees equal?

A

2 PI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

in pi - what does 180 degrees equal?

A

PI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In pi - what does 90 degrees equal?

A

PI / 2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a JavaScript formula for converting degrees to radians?

A

radians = degrees * Math.PI / 180;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a JavaScript formula for converting radians to degrees?

A

degrees = radians * 180 / Math.PI;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The opposite side to an angle…

A

does not touch the angle

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The adjacent side to an angle…

A

touches the angle (and is not the hypotenuse)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The sine of an angle is…

A

the ratio of the lengths of the side opposite the angle and the hypotenuse

opposite side / hypotenuse

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

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?

A

convert the angle to radians

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What do you need to remember about angles in JavaScript?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the cosine of an angle defined as?

A

Ratio of the adjacent leg of an angle to the Hypotenuse

adjacent leg / hypotenuse

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

You need to find out the cosine of an angle 30 degrees - how would you do that?

A

Math.cos(30 * Math.PI / 180)

NOTE: We have to convert to radians first!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

You need to find out the sine of an angle 30 degrees, how would you do that?

A

Math.sin(30 * Math.PI / 180)

NOTE: We have to convert to radians first!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

In a triangle, the cosine of one angle is the…

A

sine of the other angle

17
Q

The tangent of an angle is the ratio of…

A

the opposite leg and the adjacent leg

opposite leg / adjacent leg

18
Q

What does Math.asin do?

A

It’s the arcsine - it does the reverse of sin.

Pass in an ratio and it will give you the angle.

19
Q

How would you determine the angle given an opposite leg and a hypotenuse of 1 and 2?

A
Math.asin(1 / 2) * 180 / Math.PI;
Gives 30 (or 29.999);
20
Q

How would you determine the angle given an adjacent leg and hypotenuse of 1.73 and 2?

A
Math.acos(1.73 / 2) * 180 / Math.PI;
Gives 30 (or 29.999)
21
Q

What does Math.atan do?

A

It’s the arctangent - it does the reverse of tangent

Pass in the ratio and it will give you the angle

22
Q

How would you determine the angle given the opposite leg and adjacent leg of -1 and 1.73?

A

Math.atan(-1 / 1.73) * 180 / Math.PI

23
Q

What is the downside to using Math.atan?

A

If you ratios of -1 and -2, or 1 and 2 - they will give you the same ratio 0.5. So it’s not possible to determine which triangle the result will be refering too.

24
Q

What is Math.atan2(y, x)?

A

It’s like Math.atan - however, it takes the measurement of the opposite side, and the adjacent side as separate parameters.

25
Q

What is the sine of 0?

A

0

26
Q

What does a sign wave represent?

A

The values of sine for all the angles from 0 to 360

27
Q

What are the two main coordinate systems?

A

Polar and Cartesian

28
Q

How would you find the polar coordinates given an x and y coordinate, around a central position?

A
var originx = 100;
var originy = 100;
var positionx = 150;
var positiony = 150;
radians = Math.atan2(positiony - originy, positionx - originx);
29
Q

What do you have to keep in mind with results from atan2?

A

The range is between [-π, π] - which means you don’t know the 360 value. To change this, (assuming radians)…

if (angle