code: public Matrix3f set(Quaterniondc q) {
          double w2 = q.w() * q.w();
          double x2 = q.x() * q.x();
          double y2 = q.y() * q.y();
          double z2 = q.z() * q.z();
          double zw = q.z() * q.w();
          double xy = q.x() * q.y();
          double xz = q.x() * q.z();
          double yw = q.y() * q.w();
          double yz = q.y() * q.z();
          double xw = q.x() * q.w();
          m00 = (float) (w2 + x2 - z2 - y2);
          m01 = (float) (xy + zw + zw + xy);
          m02 = (float) (xz - yw + xz - yw);
          m10 = (float) (-zw + xy - zw + xy);
          m11 = (float) (y2 - z2 + w2 - x2);
          m12 = (float) (yz + yz + xw + xw);
          m20 = (float) (yw + xz + xz + yw);
          m21 = (float) (yz + yz - xw - xw);
          m22 = (float) (z2 - y2 - x2 + w2);
          return this;
      }
docs: Set this matrix to a rotation - and possibly scaling - equivalent to the given quaternion.
  <p>
  Reference: <a href="http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToMatrix/">http://www.euclideanspace.com/</a>
  
  @param q
  the quaternion
  @return this