Math
Ratios of Directed Line Segments Calculator
Enter the endpoints A and B and a ratio m:n (or the fraction of the way from A to B). mathcheck applies the section formula, P = ((m·x2 + n·x1)/(m + n), (m·y2 + n·y1)/(m + n)) for internal division and the subtraction version for external division, keeps the coordinates as exact fractions, verifies the distances AP and PB, and draws the segment with P marked.
Impossible cases, such as external division with m = n, are explained rather than computed.
AP : PB = m : n.
Try an example
Result
Point P
—
- P (decimal)
- —
- Ratio
- —
- AP
- —
- PB
- —
- AB
- —
- Position
- —
Student quick launch
Grade planning, algebra checks, and formulas students reach for most.
Study path
Use this calculator with
Follow these when you want the formula behind the answer, a short lesson, or nearby tools in the same topic.
The section formula
A point P divides the directed segment from A to B in the ratio m:n when AP : PB = m : n. For internal division P lies between A and B and its coordinates are weighted averages of the endpoints, with B weighted by m and A by n (the weight goes to the far endpoint). For external division P lies on the line outside the segment and the weights subtract.
Divide A(1, 2) to B(7, 8) in the ratio 1:2
x = (1·7 + 2·1)/(1 + 2) = 9/3 = 3, y = (1·8 + 2·2)/3 = 12/3 = 4. P = (3, 4), one third of the way from A to B. Check: AP = 2√2 and PB = 4√2, ratio 1:2.
| Ratio m : n | t = m/(m + n) | Where P is |
|---|---|---|
| 1 : 1 | 1/2 | midpoint |
| 1 : 2 | 1/3 | one third of the way from A |
| 2 : 1 | 2/3 | two thirds of the way from A |
| 0 : 1 | 0 | at A |
| external 2 : 1 | 2 | beyond B, as far past B as B is from A |
How to use this calculator
- Enter the endpoints A and B.
- Choose internal or external division, then give the ratio m:n or the fraction of the way from A to B.
- Read P as an exact fraction pair and as decimals, with the distances AP, PB, and AB below it.
- Check the graph to see P on the segment or on its extension.
- Open Show the work for the formula substitution and the distance check.
How to read the answer
P's coordinates are exact fractions. The position line says how far along the segment P sits, and the distance check confirms AP : PB matches m : n. External division puts P past B when m > n and past A when m < n; m = n is impossible externally because the point would recede to infinity.
Common mistakes and edge cases
- Reversing m and n, which puts P the wrong distance from A.
- Adding the weights to the wrong endpoints: B gets m and A gets n.
- Using the internal formula for an external point, or vice versa.
- Trying external division with m = n; the The bottom number of a fraction; it says how many equal parts make one whole. m - n is 0.
- Confusing 'the ratio 1:3' (AP : PB = 1 : 3, so t = 1/4) with 'one third of the way' (t = 1/3, ratio 1:2).
Worked examples
One third of the way
A(1, 2), B(7, 8), ratio 1:2
Point P
(3, 4)
Midpoint
A(0, 0), B(3, 5), ratio 1:1
Point P
(3/2, 5/2) ≈ (1.5, 2.5)
Fraction of the way
A(-2, 4), B(6, -4), 1/4 of the way
Point P
(0, 2)
External division beyond B
A(1, 2), B(7, 8), ratio 2:1 external
Point P
(13, 14)
External division beyond A
A(1, 2), B(7, 8), ratio 1:3 external
Point P
(-2, -1)
Decimal endpoints
A(0.5, 0), B(2.5, 1), ratio 3:1
Point P
(2, 3/4) ≈ (2, 0.75)
External with m = n
Point P
—
Identical endpoints
Point P
—
Frequently asked questions
What is the section formula?+
For AP : PB = m : n with P between A and B: P = ((m·x2 + n·x1)/(m + n), (m·y2 + n·y1)/(m + n)). It is a weighted average that gives B the weight m and A the weight n.
What does 'directed line segment' mean?+
The segment has a start (A) and an end (B), so the ratio m:n is read as AP : PB in that direction. Reversing the direction swaps m and n.
How is external division different?+
The point lies on the line through A and B but outside the segment. The formula subtracts instead of adds: P = ((m·x2 - n·x1)/(m - n), (m·y2 - n·y1)/(m - n)), and m must not equal n.
How do I find a point a fraction of the way from A to B?+
Use P = A + t·(B - A). A fraction t = 1/3 corresponds to the ratio 1:2, because AP : PB = t : (1 - t).
Is the midpoint a special case?+
Yes. With m = n the section formula reduces to the midpoint formula ((x1 + x2)/2, (y1 + y2)/2).
Does the formula work in three dimensions?+
Yes; apply the same weighted average to the z-coordinates as well. This page handles the 2D case with a graph.
About this calculator
- Written by
- mathcheck editorial team
- Last reviewed
- September 4, 2026
Method
- Uses the values entered by the user and stable formulas documented on the page.
Related calculators
Midpoint Calculator
Find the midpoint between two coordinate points with coordinate-average steps.
Endpoint Calculator
Find the missing endpoint of a segment from one endpoint and the midpoint (or the midpoint from two endpoints), with the segment length, the line through the points, and steps.
Distance Formula Calculator
Find the distance between two coordinate points with dx, dy, squared distance, and square-root steps.
Ratio Calculator
Simplify ratios, compare two quantities, and find unit rates with clear proportional reasoning steps.
Linear Interpolation Calculator
Interpolate a value between two known points with the formula y = y1 + (x - x1)(y2 - y1)/(x2 - x1), exact fractions, the slope and line equation, inverse interpolation (find x for a given y), an extrapolation warning, and a graph.
Slope Calculator
Find slope from two points, solve a missing coordinate from a known slope, or turn an angle or percentage grade into a slope. Includes equations, intercepts, perpendicular slope, graph, and step-by-step work.
Last updated: September 4, 2026