Conditions of equilibrium for floating bodies