code: public static Vector3d[] calcInvertedAxes(Vector3d aAxis, Vector3d bAxis, Vector3d cAxis) {
          double det = aAxis.x * bAxis.y * cAxis.z - aAxis.x * bAxis.z * cAxis.y - aAxis.y * bAxis.x * cAxis.z + aAxis.y
                  * bAxis.z * cAxis.x + aAxis.z * bAxis.x * cAxis.y - aAxis.z * bAxis.y * cAxis.x;
          Vector3d[] invaxes = new Vector3d[3];
          invaxes[0] = new Vector3d();
          invaxes[0].x = (bAxis.y * cAxis.z - bAxis.z * cAxis.y) / det;
          invaxes[0].y = (bAxis.z * cAxis.x - bAxis.x * cAxis.z) / det;
          invaxes[0].z = (bAxis.x * cAxis.y - bAxis.y * cAxis.x) / det;
  
          invaxes[1] = new Vector3d();
          invaxes[1].x = (aAxis.z * cAxis.y - aAxis.y * cAxis.z) / det;
          invaxes[1].y = (aAxis.x * cAxis.z - aAxis.z * cAxis.x) / det;
          invaxes[1].z = (aAxis.y * cAxis.x - aAxis.x * cAxis.y) / det;
  
          invaxes[2] = new Vector3d();
          invaxes[2].x = (aAxis.y * bAxis.z - aAxis.z * bAxis.y) / det;
          invaxes[2].y = (aAxis.z * bAxis.x - aAxis.x * bAxis.z) / det;
          invaxes[2].z = (aAxis.x * bAxis.y - aAxis.y * bAxis.x) / det;
          return invaxes;
      }
docs: Inverts three cell axes.
  
  @return         a 3x3 matrix with the three Cartesian vectors representing
  the unit cell axes. The a axis is the first row.