Tidal alignment of galaxies