General Equations for the Equilibrium Shape of a Fluid Interface and for Its Angle of Contact with a Solid