code: public double[] mult(double[] vec, double[] out) {
          if (out == null || out.length != 2) {
              out = new double[2];
          }
  
          if (vec == out) {
              double tx = m00*vec[0] + m01*vec[1] + m02;
              double ty = m10*vec[0] + m11*vec[1] + m12;
  
              out[0] = tx;
              out[1] = ty;
          } else {
              out[0] = m00*vec[0] + m01*vec[1] + m02;
              out[1] = m10*vec[0] + m11*vec[1] + m12;
          }
  
          return out;
      }
docs: Multiply a two element vector against this matrix.
  If out is null or not length four, a new double array will be returned.
  The values for vec and out can be the same (though that's less efficient).