Four Weights, One Toy Plane: Moment of Inertia in Python

Two toy airplanes with the same four weights; moving wing weights outward changes yaw inertia from 4 to 10 kg m squared, with a Python logo.
A toy model with four equal weights. The Python icon signals the calculation that follows.

Lay four 1 kg weights on a toy airplane: one at the nose, one at the tail, and one on each wing. Move the two wing weights outward by the same amount. What would change if the plane turned around a vertical axle?

Either layout has a total mass of 4 kg, and the balance point stays put. But under the same net turning torque, the layout with the wider weights gains angular speed more slowly.

Can we predict how much slower? A few coordinates, a hand calculation, and Python will give us a number.

Four weights on the workbench

Imagine a flat, rigid frame with almost no mass of its own. Each of our four weights has a mass of 1 kg. We treat each weight as if its whole mass sits at a single point. This is a toy model, not a real flight-ready airplane.

Look down on the toy. Draw two axes: x runs from tail toward nose; y runs across the wings. The two lines cross at (0, 0). In the diagram, +x points up toward the nose and +y points to the right.

Weight x (m) y (m)
Nose +1 0
Tail −1 0
Upper wing 0 +1
Lower wing 0 −1

First place the wing weights at y = +1 m and −1 m. Then try y = +2 m and −2 m. Keep both nose and tail weights at their first positions. Which change will matter more: the balance point, or the resistance to turning?

Corrected top-view coordinate diagram: x points toward the nose and y across the wings; the four 1 kg masses keep CG at (0, 0) while wing distances grow from 1 m to 2 m.
The x and y axes now agree with the coordinate table. Only the two wing weights move; total mass and CG stay fixed.

The balance point refuses to move

In the earlier center-of-mass problem, we learned to multiply each mass by its position and divide by total mass. The same rule works in two directions:

xCG = (Σ mx) / Σm

yCG = (Σ my) / Σm

Here Σ means “add the parts.” Both versions have a total mass of 4 kg. The positive and negative positions cancel, so the CG stays at (0, 0) m.

A balance point tells us where the mass is centered. It cannot, on its own, tell us how the parts resist a turn.

But which axis are we turning around?

An airplane can roll, pitch, or yaw. Let's look at yaw: its nose moves left or right when seen from above. Imagine a vertical axle through the CG. Our flat toy spins around that axle.

For a point mass, we measure its distance r from the axle. If the mass sits at coordinates (x, y) and the CG is at (xCG, yCG), then:

r² = (x − xCG)² + (y − yCG)²

For all four weights, yaw moment of inertia is:

Izz = Σ m[(x − xCG)² + (y − yCG)²]

This is the same I = Σmr² rule from the last lesson, now written for a plane with x and y positions. The unit is kg·m². The choice of axis matters. OpenStax explains why moment of inertia depends on the axis, and NASA shows the three aircraft rotation axes.

Only two weights change the sum

Make a guess before you add: the wing distances double. Will the whole plane’s moment of inertia become two times, four times, or something else?

Start with the wing weights at ±1 m. Each 1 kg weight sits 1 m from the axle, so each adds 1 × 1² = 1 kg·m².

Four weights give 1 + 1 + 1 + 1 = 4 kg·m².

Now slide only the two wing weights out to ±2 m. Each one adds 1 × 2² = 4 kg·m². The nose and tail still add 1 each:

Izz = 1 + 1 + 4 + 4 = 10 kg·m²

Yaw moment of inertia contributions: nose and tail remain 2 kg m squared; wings increase from 2 to 8, making totals 4 and 10.
The nose and tail still contribute 2 kg·m²; the two wing weights rise from 2 to 8. The total goes from 4 to 10.

Here is the catch: moving a mass twice as far from an axis makes that mass’s contribution four times larger. It does not make every other part of the plane move farther out. The whole result is 10/4 = 2.5 times the original, not four times.

Before you run the program, make one more guess. If only the wing weight at y = +1 m moves to y = +2 m, will the CG still sit at (0, 0)?

Let Python count the pieces

The program keeps each weight as a short row of data: its name, mass, x, and y. It finds the center of mass first, then checks how far each weight sits from the new center. Finally, it adds the four contributions. The same steps work even when the layout is no longer symmetric.

"""Toy airplane: CG and yaw moment of inertia of four point masses.

Python 3, no packages required. All distances in meters and masses in kg.
Assumes a rigid, massless frame and a vertical yaw axis through the CG.
"""

def make_plane(wing_distance):
    # Each row: (part name, mass in kg, x in m, y in m)
    return [
        ("nose",       1.0,  1.0,  0.0),
        ("tail",       1.0, -1.0,  0.0),
        ("right wing", 1.0,  0.0,  wing_distance),
        ("left wing",  1.0,  0.0, -wing_distance),
    ]


def mass_properties(parts):
    total_mass = sum(m for name, m, x, y in parts)
    if total_mass <= 0:
        raise ValueError("Total mass must be greater than zero")

    x_cg = sum(m * x for name, m, x, y in parts) / total_mass
    y_cg = sum(m * y for name, m, x, y in parts) / total_mass

    i_zz = 0.0
    for name, m, x, y in parts:
        distance_squared = (x - x_cg)**2 + (y - y_cg)**2
        i_zz += m * distance_squared

    return total_mass, x_cg, y_cg, i_zz


if __name__ == "__main__":
    for d in (1.0, 2.0):
        mass, cg_x, cg_y, i_zz = mass_properties(make_plane(d))
        print(f"Wing distance {d:.1f} m | mass {mass:.1f} kg | "
              f"CG ({cg_x:.2f}, {cg_y:.2f}) m | Izz {i_zz:.1f} kg*m^2")

    # Optional experiment: move one wing weight.
    parts = make_plane(1.0)
    parts[2] = ("right wing", 1.0, 0.0, 2.0)
    mass, cg_x, cg_y, i_zz = mass_properties(parts)
    print(f"One wing moved  | mass {mass:.1f} kg | "
          f"CG ({cg_x:.2f}, {cg_y:.2f}) m | Izz {i_zz:.2f} kg*m^2")

    assert mass_properties(make_plane(1.0)) == (4.0, 0.0, 0.0, 4.0)
    assert mass_properties(make_plane(2.0)) == (4.0, 0.0, 0.0, 10.0)
    assert mass_properties(parts) == (4.0, 0.0, 0.25, 6.75)

Running the complete program prints all three cases:

Wing distance 1.0 m | mass 4.0 kg | CG (0.00, 0.00) m | Izz 4.0 kg*m^2
Wing distance 2.0 m | mass 4.0 kg | CG (0.00, 0.00) m | Izz 10.0 kg*m^2
One wing moved  | mass 4.0 kg | CG (0.00, 0.25) m | Izz 6.75 kg*m^2

You need only standard Python 3. No extra package is required. The program also checks all three answers with assert. The last line of output comes from moving just one weight.

One weight breaks the symmetry

When just one weight moves, the two sides no longer balance about the old origin.

The new CG is (0, 0.25) m. Because the balance point moves, you must measure each squared distance from the new CG, not from the old origin.

Compare the new CG and inertia with the two symmetric cases.

The program gives Izz = 6.75 kg·m². If you instead keep a fixed physical axle at the old origin (0, 0), inertia about that axle is 7.00 kg·m². We use 6.75 because our question is about the yaw axis through the new CG. An axis must always be named before inertia is calculated.

This is when code earns its place: a moved component changes both the balance point and the distances we need for the next calculation.

Where this toy model stops

A real plane has mass spread through its wings, body, engine, battery, and other parts. Its true inertia may include products of inertia too. This toy ignores all of that. More inertia around yaw does not, by itself, make the plane more stable: aerodynamics and controls matter as well.

For this toy, though, we can make one fair comparison. If both versions get the same net yaw torque about the CG, the version with Izz = 10 has only 4/10 as much yaw angular acceleration as the version with Izz = 4. That is the meaning of τ = Iα for this fixed-axis model.

Look again at the two layouts. Nothing became heavier. Nothing moved the balance point. But the wing weights moved away from the yaw axis, and the resistance to changing rotation grew. Python did not discover a new law; it counted a change we could already see.

And if we stop pretending that every part lies in a flat plane, a new question appears: can one number describe every way a real aircraft turns?

Sources and further reading