Vectors

A vector can be thought of as an arrow from a given initial point to another point in 3D space. It describes both the direction and the length of an arrow. The direction describes where the arrowhead points to. A vector is different from a line segment which is "bi-directional". Rays are different due to their infinite length.

A vector's starting point can be the world origin (0,0,0), or it can be the origin of an object's local coordinate system.

Unit Vectors
When a vector is scaled to a length of 1 we call it normalized (or "unitized"). Normalized vectors (or unit vectors) are used to describe only a direction (many mathematical algorithms requires unit vectors for expected results).

Here are some common vector operations and what they are used for:

Vector Addition & Subtraction

 * Subtracting vector A from vector B generates a third vector that contains the direction and distance from A to B.

Adding vector A and vector B gives vector C. You can visualize this as if you take vector B, and place its tail on vector A's head (like two arrows drawing out a path). Vector C is then the vector from the start of the path (A's tail) to the end of the path (B's head). Equivalently, you could get the same vector C by lining up the vectors in the opposite order: placing vector A's head at vector B's tail.

Vector Multiplication
Multiplying or dividing a vector by a scalar (read: a number) does not change the direction, but only changes the length of the vector. For instance the vector (1,1,1) describes a line that is angled 45 degrees off the XZ plane (horizontal), 45 degrees off the XY plane (vertical, faces towards you) and 45 degrees off the YZ plane (vertical, faces left/right). The length of the line is sqrt(x^2 + y^2 + z^2) - or, in this example, sqrt(3) which is about 1.73. Now if we multiply this vector by 2 we get (2,2,2). This describes a line with the exact same angles. However the length is now sqrt(12) or 3.46 (which is 1.73 times 2). See Vector3::length.

Vector CrossProduct
A cross product of two vectors provides a third vector that is perpendicular to the initial two. Figure out which way is up/out from a polygon by taking the cross product of two edges = vector pointing out.

The dot product of two vectors allows us to find the angle between them. It is defined as

Where Len1 and Len2 are the length of the vectors. However typically you should normalize both vectors so the lengths are 1. This means the dot product is the cosine of the angle between the vectors. Stated another way:

Source
http://wiki.ogre3d.org/Quaternion+and+Rotation+Primer