Posts Tagged ‘vectors’

Vectors – Part 1

Tuesday, December 15th, 2009

One of the biggest challenges for a game programmer is understanding how to represent position and movement in 2D and 3D space. In this tutorial I will teach you the basics of understanding vectors in 2D and 3D space.

Vectors

For the most part, we use vectors. In math and physics, vectors are usually represented by a direction (angle) and a magnitude (length).
See the diagram below (imagine the hypotenuse as an arrow):

Triangle

Theta (displayed as θ) is your angle in either degrees or radians (I will always talk about angles in degrees). The hypotenuse is the longest side of the triangle (your length or magnitude). The adjacent side is the side that touches the angle you’re working with, the opposite side is the side across from the angle. The adjacent and opposite sides are often your X and Y components, respectively.

(more…)