Last updated October 5, 2026 · Report an error
The section formula finds the exact point that divides a directed line segment from P1 to P2 in a given ratio m:n — either internally, landing somewhere between the two endpoints, or externally, landing on the extended line beyond one of them. It generalizes the familiar midpoint formula: a plain midpoint is just the special case where the ratio is 1:1. This formula appears throughout coordinate geometry and its applications: finding a point that divides a segment in a specific proportion is used to compute a triangle's centroid (dividing each median in a 2:1 ratio), to locate a point along a route or cable at a specified fraction of the total distance in engineering and mapping software, and to interpolate positions in computer graphics when an object needs to sit at a precise proportional point between two anchors.
How it works
Enter both endpoints P1(x1, y1) and P2(x2, y2), the ratio m:n, and whether the division should be internal or external. For internal division, the dividing point lands between P1 and P2 and is found with P = ((mx2+nx1)/(m+n), (my2+ny1)/(m+n)) — essentially a weighted average of the two endpoints, weighted by the opposite ratio term. For external division, the point lands on the same line but beyond one of the endpoints, and one sign in the formula flips: P = ((mx2−nx1)/(m−n), (my2−ny1)/(m−n)). Because the external formula divides by (m − n), it becomes undefined whenever m equals n, since an external division in an exact 1:1 ratio has no finite solution — the "point" would need to sit infinitely far away.
- Enter p1 — x1.
- Enter p1 — y1.
- Enter p2 — x2.
- Enter p2 — y2.
- Enter ratio — m.
- Enter ratio — n.
- Enter division type.
- Click Calculate to see your results.
Examples
(0,0) to (10,15), ratio 2:3 internal
P = ((2×10+3×0)/(2+3), (2×15+3×0)/(2+3)) = (20/5, 30/5) = (4, 6) — a point closer to P1 since the ratio weights it more heavily toward that end.
(0,0) to (10,15), ratio 3:2 external
P = ((3×10−2×0)/(3−2), (3×15−2×0)/(3−2)) = (30/1, 45/1) = (30, 45) — a point well beyond P2, since external division always places the result outside the original segment.
(2,2) to (8,10), ratio 1:1 internal
P = ((1×8+1×2)/2, (1×10+1×2)/2) = (10/2, 12/2) = (5, 6) — exactly the midpoint of the segment, confirming that a 1:1 internal ratio is just the ordinary midpoint formula in disguise.
Common mistakes to avoid
- Using equal m and n values for external division, which causes an undefined division-by-zero result (m − n = 0).
- Swapping P1 and P2 without also swapping which end of the ratio (m or n) corresponds to which point.
- Confusing internal and external division and expecting a point between the endpoints when external division was actually selected.
- Assuming the ratio m:n must be written in lowest terms — it doesn't; 4:6 and 2:3 produce exactly the same dividing point.