Usefull formulas for working with matricies
The style of matrix and vector I will use throughout

The Identity matrix any matrix multiplied by the identity is itself (a usefull starting point).

4x4 Matrix multiplication,
click here for a larger view 
Transforming a point by multiplying by a matrix.

Matrix to rotate a point around the X axis

Matrix to rotate a point around the Y axis

Matrix to rotate a point around the Z axis

Matrix to rotate a point around the given axis
click here for a larger view 
Matrix to translate a point by the vector given (w should normally be 1)

Matrix to scale a point by the vector given (w should normally be 1)
ExampleInitial matrix setup.

M x RotX90 x RotY90 x V = new_V

M x RotY90 x RotX90 x V = new_V

This actually shows that matrix multiplication is not commutative as AB != BA.