Resistance matrix for a particle in a nonuniform gas flow