title: explanation of matrix - augmented reality browser using android
body: <p>I am developing augmented reality camera application in which nearby locations would be augmented on the camera screen. I need to find the orientation of device. I am using accelerometer sensor with magnetic sensor. And i am learning all these from the code which is on github.</p>
  
  <ul>
  <li><p>I am unable to understand this <a href="https://github.com/RaghavSood/ProAndroidAugmentedReality/blob/master/Pro%20Android%20AR%209/src/com/paar/ch9/Matrix.java" rel="nofollow">matrix class.</a> <strong>Can anyone please
  tell me what are a1,a2,.....c2,c3 ?</strong></p>
  
  <p>private volatile float a1=0f, a2=0f, a3=0f;</p>
  
  <p>private volatile float b1=0f, b2=0f, b3=0f;</p>
  
  <p>private volatile float c1=0f, c2=0f, c3=0f;</p></li>
  </ul>
  
  <p>This is the <a href="https://github.com/RaghavSood/ProAndroidAugmentedReality/blob/master/Pro%20Android%20AR%209/src/com/paar/ch9/SensorsActivity.java" rel="nofollow">SensorActivity</a> where this matrix class is used.</p>
  
  <ul>
  <li><p><strong>Also tell me why do I need to use this 9 value matrix and which
  values need to pass to this matrix class.</strong></p>
  
  <p>For example in the SensorActivity why we are using angleX and angleY.</p>
  
  <pre><code> double angleX = Math.toRadians(-90);
  
   double angleY = Math.toRadians(-90);
  
      xAxisRotation.set( 1f, 
              0f, 
              0f, 
              0f, 
              (float) Math.cos(angleX), 
              (float) -Math.sin(angleX), 
              0f, 
              (float) Math.sin(angleX), 
              (float) Math.cos(angleX));
  </code></pre></li>
  </ul>
  
  <p>So, what is angleX and angleY. What are all these parameters?  </p>