private void calculateGyro(long timeStamp) {
		// don't start until first accelerometer/magnetometer orientation has been acquired
		if (!hasOrientation) {
			return;
		}

		// Initialization of the gyroscope based rotation matrix
		if (!initState) {
			gyroMatrix = matrixMultiplication(gyroMatrix, rotationMatrix);
			initState = true;
		}

		if (this.timeStamp != 0) {
			float dT = (timeStamp - this.timeStamp) * NS2S;
			getRotationVectorFromGyro(dT / 2.0f);
		}

		// measurement done, save current time for next interval
		this.timeStamp = timeStamp;

		// Get the rotation matrix from the gyroscope
		getRotationMatrixFromVector(deltaMatrix, deltaVector);

		// Apply the new rotation interval on the gyroscope based rotation matrix to form a composite rotation matrix.
		// The product of two rotation matricies is a rotation matrix... Multiplication of rotation matrices
		// corresponds to composition of rotations... Which in this case are the rotation matrix from the fused
		// orientation and the rotation matrix from the current gyroscope outputs.
		gyroMatrix = matrixMultiplication(gyroMatrix, deltaMatrix);

		// Get the gyroscope based orientation from the composite rotation matrix. This orientation will be fused via
		// complementary filter with the orientation from the acceleration sensor and magnetic sensor.
		getOrientation(gyroMatrix, gyroOrientation);
	}