The metacentric height (GM) is a measurement of the initial static stability of a floating body. It is calculated as the distance between the centre of gravity of a ship and its metacentre. A larger metacentric height implies greater initial stability against overturning. The metacentric height also influences the natural period of rolling of a hull, with very large metacentric heights being associated with shorter periods of roll which are uncomfortable for passengers. Hence, a sufficiently, but not excessively, high metacentric height is considered ideal for passenger ships. When a ship heels (rolls sideways), the centre of buoyancy of the ship moves laterally. It might also move up or down with respect to the water line. The point at which a vertical line through the heeled centre of buoyancy crosses the line through the original, vertical centre of buoyancy is the metacentre. The metacentre remains directly above the centre of buoyancy by definition. In the diagram above, the two Bs show the centres of buoyancy of a ship in the upright and heeled conditions. The metacentre, M, is considered to be fixed relative to the ship for small angles of heel; however, at larger angles the metacentre can no longer be considered fixed, and its actual location must be found to calculate the ship's stability. It can be calculated using the formulae: Where KB is the centre of buoyancy (height above the keel), I is the second moment of area of the waterplane around the rotation axis in metres4, and V is the volume of displacement in metres3. KM is the distance from the keel to the metacentre. Stable floating objects have a natural rolling frequency, just like a weight on a spring, where the frequency is increased as the spring gets stiffer. In a boat, the equivalent of the spring stiffness is the distance called "GM" or "metacentric height", being the distance between two points: "G" the centre of gravity of the boat and "M", which is a point called the metacentre. Metacentre is determined by the ratio between the inertia resistance of the boat and the volume of the boat.