Ratios of Directed Line Segments Calculator
Enter the endpoints of a directed line segment and the ratio m:n to find the exact coordinates of the point P that partitions the segment. Choose internal division (P lies between A and B) or external division (P lies on the extension beyond B). You can also reverse-solve: enter all three points to discover the ratio. Step-by-step working is shown for every result.
Formula
Worked example
Given A(1, 2) and B(4, 6), find P for an internal ratio of 2:3. x: (2*4 + 3*1)/(2+3) = (8+3)/5 = 11/5 = 2.2. y: (2*6 + 3*2)/(2+3) = (12+6)/5 = 18/5 = 3.6. So P = (2.2, 3.6). For external division with the same ratio 2:3, the denominator becomes 2-3 = -1: x: (2*4 - 3*1)/(2-3) = (8-3)/(-1) = -5. y: (2*6 - 3*2)/(2-3) = (12-6)/(-1) = -6. So the external point P = (-5, -6).
What is a directed line segment?
A directed line segment is a segment with a defined starting point A and a terminal (ending) point B. The direction matters: segment AB and segment BA are distinct directed segments pointing opposite ways. When you partition a directed segment in ratio m:n, you are measuring m parts from A toward B for every n parts remaining toward B. This direction convention ensures the algebra of the section formula gives consistent results for both internal and external division.
Internal vs. external division
Internal division places point P strictly between A and B, so AP:PB = m:n with m, n > 0. The formula is P = ((mx2 + nx1)/(m+n), (my2 + ny1)/(m+n)). External division places P on the extension of the line through A and B, beyond one of the endpoints. The formula uses subtraction: P = ((mx2 - nx1)/(m-n), (my2 - ny1)/(m-n)). When m = n in external division the denominator is zero and the point is at infinity, meaning the lines are parallel and never meet at a finite point. External division naturally arises in problems involving harmonic conjugates, projective geometry, and certain optics constructions.
How to find the ratio from three points
If you know all three collinear points A, P and B, you can recover the ratio m:n by solving the section formula in reverse. Rearranging the x-coordinate equation gives m/n = (Px - Ax)/(Bx - Px), provided Bx is not equal to Px. If the x-coordinates are too close (near-vertical segment), use the y-coordinate equation instead: m/n = (Py - Ay)/(By - Py). A positive ratio means P lies between A and B (internal), and a negative ratio means P lies on the extension (external). This calculator applies both checks automatically and uses the axis with the larger spread to minimise rounding error.
Special cases and verification
When m:n = 1:1 the section formula reduces to the midpoint formula: P = ((x1+x2)/2, (y1+y2)/2). For a ratio 1:2 (P one-third from A) and 2:1 (P two-thirds from A), the formula gives the two trisection points. You can verify any result by checking that AP/PB equals the input ratio m/n, and that the distance AP + PB equals AB for internal division (or |AP - PB| = AB for one external case). This calculator displays AP, PB, and AB so you can confirm the arithmetic at a glance.
Common partition ratios and their meaning
| Ratio m:n | Location of P | Fraction from A |
|---|---|---|
| 1:1 | Midpoint of AB | 1/2 |
| 1:2 | First trisection point (closer to A) | 1/3 |
| 2:1 | Second trisection point (closer to B) | 2/3 |
| 1:3 | Quarter point (closer to A) | 1/4 |
| 3:1 | Three-quarter point (closer to B) | 3/4 |
| 1:4 | One-fifth from A | 1/5 |
| 4:1 | Four-fifths from A | 4/5 |
For internal division of segment AB where A and B are distinct endpoints.
Frequently asked questions
What is the section formula for internal division?
For a directed segment from A(x1, y1) to B(x2, y2) divided internally in ratio m:n, the dividing point P has coordinates: Px = (mx2 + nx1)/(m+n) and Py = (my2 + ny1)/(m+n). Both m and n must be positive, and P lies strictly between A and B.
What is the section formula for external division?
For external division in ratio m:n, the formula uses subtraction: Px = (mx2 - nx1)/(m-n) and Py = (my2 - ny1)/(m-n). P lies on the line through A and B but outside the segment. If m equals n the denominator is zero and no finite dividing point exists.
How do I find the midpoint using this calculator?
Set the mode to 'Find point P from ratio m:n', choose internal division, and set both m and n to 1. The section formula then simplifies to the midpoint formula: Px = (x1+x2)/2, Py = (y1+y2)/2.
Can I find the ratio if I know all three points?
Yes. Switch to the 'Find ratio from three points' mode, enter A, B and P. The calculator solves (Px - Ax)/(Bx - Px) for the ratio m:n, and flags whether the division is internal (positive ratio) or external (negative ratio).
Why are there two different formulas for internal and external division?
Internal division uses addition because P is a weighted average of A and B. External division uses subtraction because P lies outside AB, so one weight effectively pulls in the opposite direction. Both formulas follow directly from the parametric line equation P = A + t(B - A), where t = m/(m+n) for internal and t = m/(m-n) for external.