Optical-phonon anisotropies in layered crystals