A theoretical and experimental analysis of the ellipsometer