code: function composeRotation(x, y, z){
      var X = new Matrix([ [1, 0, 0], [0, cos(x), -sin(x)], [0, sin(x), cos(x)] ]),
          Y = new Matrix([ [cos(y), 0, sin(y)], [0, 1, 0], [-sin(y), 0, cos(y)] ]),
          Z = new Matrix([ [cos(z), -sin(z), 0], [sin(z), cos(z), 0], [0, 0, 1] ]);
      return Z.dot(Y).dot(X).data;
      }
docs: Calculate rotation matrix
  based on the description by Nghia Ho at http://nghiaho.com/?page_id=846 (Cached: http://www.webcitation.org/6mHnx3sCs )
  
  @param {double} x x rotation (pitch)
  @param {double} y y rotation (roll)
  @param {double} z z rotation (yaw)
  @returns {2D array} rotation matrix 3x3