Math 255- Math Fundamentals for Game

Game mathematics turns positions, directions, forces, and shapes into calculations a computer can use. Vectors describe where objects are and where they move; trigonometry connects angles with directions; physics equations update movement over time; and collision tests help determine when objects touch or overlap.

This introduction walks through core ideas step by step, using simple numbers you can later translate into code.

A useful approach: Draw the situation → name the vectors → choose the formula → substitute numbers → check units and sign → test against the game (does it look right?).

A vector stores a magnitude and a direction as components. In a game it can be a position, a velocity, or a direction.

v=(vx,vy,vz)
OperationFormulaGame Use
Additiona+b=(ax+bx,ay+by)Combine movement and wind
Scalingkv=(kvx,kvy)Change speed
Magnitude|v|=vx2+vy2+vz2Speed or distance
Normalizev^=v|v|Direction only, length 1
Movepnew=p+vΔtUpdate position each frame
Example: Normalize v=(3,4).

Step 1: Find the magnitude.

|v|=32+42=25=5

Step 2: Divide each component by 5.

v^=(35,45)=(0.6,0.8)

Step 3: Check: 0.36+0.64=1. Conclusion: The unit direction is (0.6,0.8).

Example: Normalize v=(3,4).

Step 1: Find the magnitude.

|v|=32+42=25=5

Step 2: Divide each component by 5.

v^=(35,45)=(0.6,0.8)

Step 3: Check: 0.36+0.64=1. Conclusion: The unit direction is (0.6,0.8).