The flattenings of the layers of rotating planets and satellites deformed by a tidal potential