Calculation of the index of-refraction of an aggregate of particles