title: how to control Eigen Precision
body: <p>I'm trying to convert an Eigen 3x3 rotation matrix to a quaternion using this code:</p>
  
  <pre><code>//m_labelMatrix : raw data of vtk4x4 matrix4d.
  //m_transformationMatrix : Eigen4x4 matrix4d. 
  m_transformationMatrix = Eigen::Map&lt;Eigen::Matrix4d&gt;(m_labelMatrix);        
  m_transformationMatrix.transposeInPlace();
  //m_affinedMatrix : affine3d matrix. 
  m_affinedMatrix = m_transformationMatrix;
  auto label_pos = m_affinedMatrix.translation();
  auto rotationMatrix = m_affinedMatrix.linear();
  auto scaleX = rotationMatrix.col(0).norm();
  auto scaleY = rotationMatrix.col(1).norm();
  auto scaleZ = rotationMatrix.col(2).norm();
  
  // Make my rotation matrix orthogonal.
  rotationMatrix.col(0).normalize();
  rotationMatrix.col(1).normalize();
  rotationMatrix.col(2) = rotationMatrix.col(0).cross(rotationMatrix.col(1));
  rotationMatrix.col(2).normalize();
  rotationMatrix.col(0) = rotationMatrix.col(1).cross(rotationMatrix.col(2));
  rotationMatrix.col(0).normalize();
  
  
  Eigen::Quaterniond q(rotationMatrix);
  </code></pre>
  
  <p>But, when I try to convert back to rotation matrix i get the same matrix with some different values(I think it is an Eigen rounding problem):</p>
  
  <pre><code>  rotationMatrix = q.normalized().matrix();
    /*3.02303  0.484642 -0.124911  
    -0.559522   2.94976 -0.217941 
    0.259569   0.71415  0.984962  */ 
  </code></pre>