Determination of nanoparticle size using Rayleigh approximation and Mie theory