Geometrical theory of coupling errors in dielectric optical waveguides