Introduction to Graphics Math

Points and Directions

A: ()
B: ()

A vector is just a list of numbers. In graphics programming a vector is often times a 3 element vector that represents either a point in space or a direction. Another common vector is a 2 element vector that represents UV coordinates for texture mapping or 2D coordinates and directions. Once we get a little further along, we'll talk about 4 element vectors that represent homogeneous coordinates and how they tie in to transformation matrices. We'll start with 2 element vectors and work our way up.

Notice how a vector can represent a point or a direction. In this example there is virtually no difference between a point and a direction. Differences arise once we start transforming them with matrices (we'll get to that later). In mathematics, vector quantities are often bolded whereas scalar quantities (single numbers) aren't. We'll be following that style throughout this document. \[\textbf{A}=(A_x,A_y)=(1.0,1.0)\] \[\textbf{B}=(B_x,B_y)=(-2.0,3.0)\]