🧮
🧮 Math & statistics

Directed Line Segment Ratio Calculator (point dividing AB in m:n, internal & external)

Results update as you type.

Your numbers

Understanding the directed line segment ratio calculator — concept and principle

This calculator finds the point P that divides a directed segment from A to B in a given ratio m : n, either internally (between A and B) or externally (on the line beyond the segment). It also shows the fraction of the way from A to B and the lengths AP and PB. Use it for coordinate geometry, analytic geometry homework and design layouts.

Point dividing a segment 3:23 : 2 from A to BA(−2, 1)B(8, 6)P(4, 4)3 parts2 partsx = (2·(−2) + 3·8) ÷ 5 = 4
P is 3/5 of the way from A to B: AP = 6.71 and PB = 4.47.

How it is calculated

The principle

Moving along a straight segment changes x and y in proportion. If P is m parts of the way and there are m + n parts in all, P must be at the fraction m/(m + n) in both coordinates. Writing this out gives a weighted average of the endpoints, where each endpoint is weighted by the part of the segment on the other side; that is why x₂ is multiplied by m. The midpoint formula is the special case m = n = 1. For external division the point is outside the segment, so one of the parts points backward, which turns m + n into m − n.

Worked example

Default inputs: A(−2, 1), B(8, 6), ratio 3 : 2, internal.

  1. Fraction of the way from A: 3 ÷ (3 + 2) = 0.6.
  2. x = (2 × (−2) + 3 × 8) ÷ 5 = 20 ÷ 5 = 4.
  3. y = (2 × 1 + 3 × 6) ÷ 5 = 20 ÷ 5 = 4. So P = (4, 4).
  4. AP = √(6² + 3²) = √45 ≈ 6.7082.
  5. PB = √(4² + 2²) = √20 ≈ 4.47214, and 6.7082 : 4.47214 = 3 : 2.

How to read the result

For internal division, P always lies between A and B, and the fraction tells you how far along it is. The ratio of AP to PB should match m : n, which is a quick check. For external division, P lies on the extension of the line: beyond B if m > n, behind A if m < n.

Common mistakes

Keep in mind: The ratio is about lengths along the directed segment. In three dimensions the same formulas apply to each coordinate, but this calculator handles two coordinates only.

Frequently asked questions

What is the midpoint formula in this form?

With m = n = 1, P = ((x₁ + x₂)/2, (y₁ + y₂)/2).

How do I find the point one third of the way from A to B?

Use the ratio 1 : 2, which gives the fraction 1/3.

Why is it called a directed segment?

Because it has a start and an end; dividing from A to B differs from dividing from B to A.

Sources: OpenStax, Algebra and Trigonometry, §2.1 (midpoint and distance formulas)

Checked 9 Nov 2026. Standard section formula of coordinate geometry (internal division ((n·x₁ + m·x₂)/(m + n), (n·y₁ + m·y₂)/(m + n)); external division with m − n in place of m + n), the weighted form of the midpoint formula in OpenStax Algebra and Trigonometry §2.1.

🧮 All math & statistics tools →🌍 Calculators by country →