Physics · Mechanics · Motion & Energy

Center of mass calculator — two masses on one axis

Find the center of mass of two positive masses on one signed coordinate axis. Both positions must refer to the same origin and positive direction.

Created v1.0

By Thibaut Grzelak, Mechanical Analysis Engineer

Mechanics · Motion & Energy
01Calculation inputsx_cm = (m₁ × x₁ + m₂ × x₂) / (m₁ + m₂)
m₁m₂x₁x₂x_cm
Signed 1D axis with masses m₁ and m₂ at x₁ and x₂; x_cm marks their mass-weighted center.
Signed coordinate of m₁ in the chosen reference frame and origin.
Signed coordinate of m₂ in the same reference frame and origin as x₁.
02

Results

Total mass
—

Sum m₁ + m₂, shown as a secondary check.

Relation and numerical substitutionx_cm = (m₁ × x₁ + m₂ × x₂) / (m₁ + m₂)

—

Two positive masses represented by points on one straight coordinate axis; x₁ and x₂ are signed coordinates referenced to the same origin.

01Formulas and symbols

Formulas used

x_cmx_cm = (m₁ × x₁ + m₂ × x₂) / (m₁ + m₂)Mass-weighted average of the two signed positions.
MM = m₁ + m₂Total positive mass of the two-point system.
02Assumptions and limits

Scope of validity

  • Two positive masses represented by points on one straight coordinate axis; x₁ and x₂ are signed coordinates referenced to the same origin.
03Validation example

Reference numerical case

  1. For m₁ = 2 kg at x₁ = 0 m and m₂ = 3 kg at x₂ = 10 m, total mass is 5 kg.
  2. x_cm = (2 × 0 + 3 × 10) / (2 + 3) = 6 m.
04References

Technical references

  1. University Physics Volume 1, §9.6 Center of Mass — OpenStax

FAQ

Can the center of mass lie outside the two masses?

For this two-point model with both masses positive, no: x_cm is a weighted average and lies between x₁ and x₂. Other geometries can have a center of mass in empty space, but that is different from lying outside the two point positions.

What happens if I change the coordinate origin?

If both positions are shifted by the same amount, the computed center-of-mass coordinate shifts by that same amount. Relative geometry is unchanged, which is why x₁ and x₂ must use one common reference frame.

05How it works

The heavier mass pulls the weighted average closer to its coordinate. Equal masses place x_cm exactly halfway between x₁ and x₂; unequal masses divide the interval inversely to their masses.

06Limits of the model

This first version handles exactly two positive masses on a one-dimensional axis. It is not an arbitrary N-point editor and does not integrate a distributed mass density.

07Common mistakes

Do not mix origins or positive directions between x₁ and x₂. Signed positions are allowed; a negative coordinate is not a negative distance or a negative mass.