code: @Override
      public double[] mult(double[] source, double[] target) {
          if (target == null || target.length < 3) {
              target = new double[3];
          }
          if (source == target) {
              throw new RuntimeException("The source and target vectors used in Matrix3D.mult() cannot be identical.");
          }
          if (target.length == 3) {
              target[0] = m00 * source[0] + m01 * source[1] + m02 * source[2] + m03;
              target[1] = m10 * source[0] + m11 * source[1] + m12 * source[2] + m13;
              target[2] = m20 * source[0] + m21 * source[1] + m22 * source[2] + m23;
              //double w = m30*source[0] + m31*source[1] + m32*source[2] + m33;
              //if (w != 0 && w != 1) {
              //  target[0] /= w; target[1] /= w; target[2] /= w;
              //}
          } else if (target.length > 3) {
              target[0] = m00 * source[0] + m01 * source[1] + m02 * source[2] + m03 * source[3];
              target[1] = m10 * source[0] + m11 * source[1] + m12 * source[2] + m13 * source[3];
              target[2] = m20 * source[0] + m21 * source[1] + m22 * source[2] + m23 * source[3];
              target[3] = m30 * source[0] + m31 * source[1] + m32 * source[2] + m33 * source[3];
          }
          return target;
      }
docs: Multiply a three or four element vector against this matrix. If out is
  null or not length 3 or 4, a new double array (length 3) will be returned.