Understanding the difference between points and vectors
We can make sense of vectors by examining them in Cartesian coordinates. A vector in 2D is expressed as (x, y), in 3D as (x, y, z), and in 4D as (x, y, z, w).
Yes, I said four dimensions! At this stage, you are most likely looking at that “w” at the end of the expression and wondering where it came from. Don’t worry about it too much as its purpose will become clearer when we examine matrix multiplication.
In theory, a vector can be defined in any number of dimensions extending to infinity. They are used for complex mathematical calculations that can be found in applications relating to machine learning, astrophysics, financial analysis, and inverse kinematics, to name a few. However, in graphics, 2D, 3D, and 4D vectors are used.
Figure 9.1 illustrates a point and a vector in both 2D and 3D space. If you were to just look at the expressions for a vector, shown previously, you could be forgiven for...