Buoyancy & Stability
"Eureka!" is the famous exclamation Archimedes made when he realized that an object immersed in a fluid is pushed upward by a force equal to the weight of the fluid it displaces. This is the core principle that determines whether a heavy ship floats or sinks, and why it doesn't just tip over.
Archimedes' Principle
When you place an object in water, gravity pulls it down. But the water pushes back up. The strength of this upward push, called the buoyant force ($F_B$), is exactly equal to the weight of the water that the object moved out of the way (displaced).
Here, $\rho_{\text{fluid}}$ is the density of the fluid, $V_{\text{sub}}$ is the volume of the object that is submerged underwater, and $g$ is the acceleration due to gravity. If the buoyant force pushing up is equal to the object's total weight pulling down, the object floats!
Metacentric Stability: Why Don't Boats Tip Over?
Floating is only half the battle. A boat also needs to stay upright. To understand this, we need to look at two important points:
- Center of Gravity (CoG): The point where gravity pulls down on the entire object. For a uniform shape, it's right in the middle.
- Center of Buoyancy (CoB): The center of the submerged part of the object. This is where the buoyant force pushes up.
When a floating object tilts, its underwater shape changes. Imagine a square block tipping slightly to the right. The right side sinks deeper, and the left side lifts out. Because the submerged shape has shifted right, the Center of Buoyancy also shifts to the right.
If you draw a vertical line straight up from this new Center of Buoyancy, it will intersect the object's vertical centerline at a point called the metacenter.
The Golden Rule of Stability: If the metacenter is above the Center of Gravity, the upward push of buoyancy and the downward pull of gravity will twist the object back upright. If the metacenter is below the Center of Gravity, those same forces will cause the object to capsize and flip over! This is why a flat plank floats nicely, but a square block of light wood often prefers to float diagonally.
How do we simulate this?
In a physics engine, figuring out the exact shape of the submerged part of an object on every single frame is tricky. We use an algorithm called Sutherland-Hodgman polygon clipping. It acts like a pair of mathematical scissors, cutting the object exactly at the water line. By finding the exact area and center of that underwater shape, the computer knows exactly how much to push up, and exactly where to push it!