CCalclabhub

Science · 81 calculations

Mechanics

How To Calculate The Center Of Mass

The centre of mass of a system answers a narrow but useful question: where, on average, does its mass sit? For two point masses on a line the answer is a weighted average of their positions, with the masses acting as the weights. This page derives that result, explains why a uniform gravitational field produces no net torque there, and works through the numbers with a calculator built on the same formula.

Last updated

Quick Answer

x_cm = (m1 x1 + m2 x2) / (m1 + m2)

x_cm
Position of the centre of mass, measured from the same origin as x1 and x2
m1
Mass of the first particle
m2
Mass of the second particle
x1
Position of the first particle on the chosen line
x2
Position of the second particle on the chosen line

Add the two masses to get the total mass, multiply each mass by its position to get its first moment, then divide the moment sum by the total mass. With a 2 kilogram mass at position 1 and a 3 kilogram mass at position 7, the moment sum is 23 and the total mass is 5, so the centre of mass is at 4.6 — nearer to the heavier mass. Doubling the second mass moves the answer to 5.5.

What Is The Center Of Mass?

The centre of mass is the mass-weighted average position of a collection of matter. For two point masses sitting on a straight line, at coordinates x1 and x2, it is x_cm = (m1 x1 + m2 x2)/(m1 + m2). It is the point you would choose to balance the system on a knife-edge if both masses were connected by a light rigid rod. In a uniform gravitational field it is also the point through which the total weight appears to act. Take a 2 kilogram mass at position 1 and a 3 kilogram mass at position 7: the weighted average is 4.6, which is genuinely between the two masses but closer to the heavier one at 7.

Calling the result a weighted average is more than a loose analogy. An ordinary average of the two positions treats them equally and would give (1 + 7)/2 = 4, whereas the mass-weighted version gives 4.6 because the 3 kilogram mass counts one and a half times as much as the 2 kilogram one. The consequence is a simple inverse relationship between mass and distance from the balance point. In the worked case the centre sits 3.6 units from the lighter mass and 2.4 units from the heavier one, and 2 times 3.6 equals 3 times 2.4, both giving 7.2. Whenever one mass is much larger, the centre sits almost on top of it, which is why the Earth–Moon barycentre lies inside the Earth rather than between the two bodies.

The torque interpretation explains why this average is the physically meaningful one rather than an arbitrary statistic. In a uniform gravitational field each mass experiences a downward weight m_i g, and the torque of that weight about a candidate balance point x_p is proportional to m_i g (x_i − x_p). Adding the two torques and setting the sum to zero gives (m1 + m2) x_p = m1 x1 + m2 x2, so x_p is exactly the centre of mass. On a line the sign of the displacement carries all the directional information, so no rotation mathematics is needed. In a full three-dimensional treatment torque is a vector cross product, but the same cancellation condition produces the same vector formula for the centre.

The two parts of the fraction have standard names that are worth knowing. The numerator, m1 x1 + m2 x2, is the first moment of mass about the chosen origin, equal to 23 in the worked example. The denominator, m1 + m2, is the total mass, equal to 5 there. Dividing one by the other converts a moment into a position, which is why the answer is measured in metres rather than kilogram metres. Shifting the origin by a constant a adds a to both positions and therefore adds a to the answer as well, so a result of 4.6 is always a location relative to a stated reference, never an absolute property of the system on its own.

The sensitivity of the answer follows directly from the weighting. Replace the 3 kilogram mass by 6 kilograms and the same positions give (2 times 1 plus 6 times 7) divided by 8, which is 44 divided by 8, or 5.5 — the centre moves towards the enlarged mass. If the masses are equal, the formula collapses to the ordinary midpoint, so equal masses at 2 and 8 put the centre at 5. A 5 kilogram mass at 0 and a 1 kilogram mass at 12 give a moment sum of 12 and a total of 6, hence 2: only one sixth along the gap, because nearly all the mass is at the origin. Increasing either mass always pulls the result towards that mass's position and never away from it.

For positive masses the centre of mass can never lie outside the interval spanned by the two particles. A rearranged form makes this obvious: x_cm = x1 + [m2/(m1 + m2)](x2 − x1). The bracket is a fraction strictly between zero and one, so the answer is a fraction of the way from the first particle to the second. In the worked case m2/(m1 + m2) is 3/5, or 0.6, and 1 + 0.6 times 6 is 4.6, confirming the earlier figure. This form is also numerically convenient when the two positions are large and nearly equal, because it works with the small gap rather than subtracting two large moments. If one mass were negative the fraction could fall outside the interval, but negative mass is not part of ordinary mechanics and is excluded here.

The two-particle, one-dimensional case is a deliberate simplification of a more general idea. In three dimensions the same definition becomes r_cm = sum of m_i r_i divided by the total mass, applied separately to each coordinate. An extended body is handled by integrating position times density over its volume, which puts a uniform sphere's centre of mass at its geometric centre. For uniform density that point coincides with the centroid, a purely geometric quantity, but the two diverge as soon as the density is uneven. A loaded die has its centre of mass shifted away from the geometric middle, which is why the physical idea matters.

The same calculation appears in many practical settings. Balancing a beam, checking whether a vehicle will tip on a slope, and distributing cargo in an aircraft all reduce to a mass-weighted average position. Athletes exploit it without the arithmetic: a high jumper arched over the bar can pass it while the centre of mass passes below. In orbital mechanics the two-body barycentre obeys exactly the formula on this page, using the two masses and their separation. Recognising that one expression covers all these cases matters more than memorising any single answer.

There are clear limits to this calculation. It assumes two positive point masses, one shared coordinate system and a classical setting, and says nothing about how they are supported or how the system rotates. The zero-torque statement requires a uniform gravitational field; in a strongly varying field the centre of gravity can differ from the centre of mass. Positions must share an origin and units before substitution, and uncertainty in the inputs carries through to the answer. For extended bodies, higher dimensions or real structural loads, use the vector or integral form instead.

Formula

r_cm = SUM(m_i r_i) / SUM(m_i)

Formula page →

The general definition, valid in any number of dimensions and for any number of particles. Each position vector is multiplied by its mass, the products are added, and the total is divided by the sum of the masses. Restricting it to two particles on one line gives the formula used by the calculator.

SymbolMeaning
m_iMass of the i-th particle
r_iPosition vector of the i-th particle
MTotal mass, the sum of all particle masses

x_cm = (m1 x1 + m2 x2) / (m1 + m2)

Formula page →

The working formula for this page. With m1 = 2 at x1 = 1 and m2 = 3 at x2 = 7, the numerator is 2 times 1 plus 3 times 7, or 23, and the denominator is 5, giving x_cm = 4.6.

SymbolMeaning
m1Mass of the first particle
m2Mass of the second particle
x1, x2Positions of the two particles on the chosen line

m1 (x_cm - x1) = m2 (x2 - x_cm)

Formula page →

In a uniform field each weight produces a torque proportional to mass times distance from the balance point. Setting the two opposing torques equal recovers the same centre of mass: with the default numbers it reads 2 times 3.6 = 3 times 2.4 = 7.2.

SymbolMeaning
m1Mass on the left of the balance point
m2Mass on the right of the balance point
x_cmPosition where the net torque vanishes

How To Calculate The Center Of Mass

  1. 1

    Set one axis and a common origin

    Place both particles on a single line and choose a zero point, then record each position as a signed coordinate measured from it. A mass three units to the left of the origin has position minus three, not three. Both positions must use the same origin and the same length unit, because the answer is a location on that line rather than a free-floating distance.

  2. 2

    Add the masses to find the total mass

    Work out m1 + m2, which becomes the denominator of the calculation. With a 2 kilogram mass and a 3 kilogram mass the total is 5 kilograms. Keeping this number separate makes the later division much easier to check, and it is also the quantity that would appear in the total weight of the system.

  3. 3

    Multiply each mass by its position

    Form the two first moments and add them: m1 x1 + m2 x2. In the worked case the contributions are 2 times 1, which is 2, and 3 times 7, which is 21, giving a moment sum of 23 kilogram metres. Note that a negative position contributes a negative moment, which is how masses on opposite sides of the origin partly cancel.

  4. 4

    Divide the moment sum by the total mass

    Take the ratio of the first moment to the total mass: 23 divided by 5 gives 4.6 in the worked case. This step converts a moment into a position, so the answer carries the length unit of the original coordinates. Write the unit beside the result, and state the origin it is measured from, so that nobody mistakes it for a distance travelled.

  5. 5

    Check the location, direction and sensitivity

    For positive masses the result must lie between the two positions and nearer to the larger mass. Here 4.6 lies between 1 and 7 and is closer to 7, which is a useful sanity check in itself. Doubling the second mass should move it to 5.5, equal masses at 2 and 8 should give the midpoint 5, and multiplying both masses by the same factor should leave the answer unchanged.

Examples

Example 1: A 2 kilogram mass at 1 and a 3 kilogram mass at 7

massOne
2 kg
positionOne
1 m
massTwo
3 kg
positionTwo
7 m
StepCalculationResult
Total mass2 + 35 kg
First moment2 x 1 + 3 x 723 kg m
At double second mass(2 x 1 + 6 x 7) / (2 + 6)5.5 m
Centre of mass23 / 54.6 m

Result: 4.6 m from the origin, which is 3.6 m from the lighter mass and 2.4 m from the heavier one. Doubling the second mass would shift the centre to 5.5 m.

Example 2: Equal 3 kilogram masses at 2 and 8

massOne
3 kg
positionOne
2 m
massTwo
3 kg
positionTwo
8 m
StepCalculationResult
Total mass3 + 36 kg
First moment3 x 2 + 3 x 830 kg m
Centre of mass30 / 65 m

Result: 5 m, exactly halfway between the positions 2 m and 8 m because the two masses are equal. The lever arms on either side are both 3 m.

Example 3: A 5 kilogram mass at 0 and a 1 kilogram mass at 12

massOne
5 kg
positionOne
0 m
massTwo
1 kg
positionTwo
12 m
StepCalculationResult
Total mass5 + 16 kg
First moment5 x 0 + 1 x 1212 kg m
Centre of mass12 / 62 m

Result: 2 m from the origin, only one sixth of the way towards the 1 kilogram mass at 12 m. The heavy mass at the origin dominates the weighted average completely.

Calculator

Centre of mass

4.6

Total mass
5
First moment sum
23
If the second mass doubles
5.5

Values update as you type. This calculator covers the single scenario its formula assumes — see Common Mistakes for what it leaves out.

Prefer a full-width tool? Open the The Center Of Mass calculator page.

Common Mistakes

  • Averaging the positions without weighting by mass

    Taking (1 + 7)/2 gives 4 rather than 4.6, because it pretends both masses are equal. The weights must be the masses themselves: use (m1 x1 + m2 x2)/(m1 + m2) every time, and only simplify to the midpoint when the masses genuinely match.

  • Pairing a mass with the wrong position

    Swapping the positions while keeping the masses gives (2 times 7 plus 3 times 1) divided by 5, or 3.4, which moves the answer towards the lighter mass. Write each mass and its position together on one line before substituting, so the pairing is unambiguous.

  • Forgetting the sign of a position

    A particle to the left of the origin has a negative coordinate and produces a negative first moment. Entering it as positive can move the centre to the wrong side of the origin entirely, so draw the line and mark the zero point before doing any arithmetic.

  • Quoting a position without its origin or units

    The value 4.6 means nothing unless the reader knows it is measured in metres from the chosen zero point. Shifting the origin by a constant shifts the answer by the same amount, so always state the reference alongside the number.

  • Applying the two-particle line formula to an extended body

    An extended or off-axis system needs a vector sum, or an integral of position times density for a continuous body. Using the one-dimensional expression on a flat plate or a three-dimensional assembly silently discards whole components of the answer.

  • Confusing centre of mass with centre of gravity

    The two coincide only when the gravitational field is uniform across the system. In a strongly varying field the centre of gravity can shift, because the weights are no longer all scaled by the same acceleration. State the uniform-field assumption whenever you use the torque-balance argument.

FAQ

What exactly is the centre of mass?

It is the mass-weighted average position of all the matter in a system. For two point masses on a line it is (m1 x1 + m2 x2)/(m1 + m2). In a uniform gravitational field it is also the point about which the weights produce no net torque, so the system balances there.

Why is the answer closer to the heavier mass?

Because the heavier mass contributes a larger first moment and pulls the weighted average further towards its own position. In the default case the centre is 3.6 units from the 2 kilogram mass but only 2.4 from the 3 kilogram mass, satisfying 2 times 3.6 = 3 times 2.4.

Can the centre of mass lie outside the two particles?

Not for positive masses on a line. The rearranged form x1 + [m2/(m1 + m2)](x2 − x1) shows it is always some fraction between zero and one of the way from the first position to the second. It could fall outside only if one of the masses were negative, which is excluded here.

What is the difference between centre of mass and centroid?

The centroid is the geometric centre of a shape and ignores mass entirely. The centre of mass depends on how mass is distributed. They are the same for an object of uniform density, but a loaded object has its centre of mass displaced towards the denser part.

What happens if I double both masses?

Nothing at all. Doubling every mass multiplies both the numerator and the denominator by two, so the ratio is unchanged. Only a change in the relative sizes of the masses, or a change in their positions, can move the centre.

Does this work in two or three dimensions?

The same definition works, but you must apply it to each coordinate separately using position vectors. For a continuous body you integrate position times density over the volume. This calculator deliberately handles only the one-dimensional, two-particle idealisation.

References