Stability of Floating Bodies

Any floating body is subjected by two opposing vertical forces. One is the body's weight W which is downward, and the other is the buoyant force BF which is upward. The weight is acting at the center of gravity G and the buoyant force is acting at the center of buoyancy BO. W and BF are always equal and if these forces are collinear, the body will be in upright position as shown below.
 

005-floating-body-upright-position.gif