Instead of defaulting the rotation to zero, you can check if it is `undefined`. If it is `undefined` set the matrix to the identity; otherwise, compute the rotation. It'll avoid some unnecessary trig functions that way. Also use a result parameter here.