




[02 Nov 2012] | Vectors in Computer Graphics |

Vectors
Vectors have direction and magnitude. Number of components in a vector corresponds to number of dimensions. Scalar can be treated as speed or distance, and vector as velocity or offset with direction. Depending on requirements, vector can be written as row-vector or as column-vector (for example, for proper matrix multiplication):

Dot product of vectors
Dot (inner) product of vectors is one of the most usefull and used operations in computer graphics. It is equal to sum of products of corresponding components of the vectors. Result is scalar value:

- dot product has higher priority than addition and substraction

Cross product of vectors
Cross product is another usefull operation in computer graphics. It's only defined for 3-dimensional space. Result of cross product of two vectors is vector that is perpendicular to them. This property is used for calculation of normals, orthogonalization of vectors, etc. Lets look at vectors a and b:


Scalar triple product of vectors
Triple product of vectors is equal to volume of parallelepiped that is formed by vectors a, b and c:

- If two vectors (of a, b or c) are parallel, then result is equal to 0.
- If vectors a, b and c lie on same plane, then result is equal to 0.


Sun and Black Cat- Igor Dykhta (
