templated matrix
added quaternion