Ratios of Directed Line Segments Calculator — Section Formula
Enter the endpoints A(x₁, y₁) and B(x₂, y₂) and the ratio m:n to find the point P that divides segment AB in that ratio — supports both internal and external division.
Division type
P = (5, 6)
- 1
m × x₂
2 × 7 = 14 - 2
n × x₁
1 × 1 = 1 - 3
Denominator m + n
2 + 1 = 3 - 4
x coordinate of P
(14 + 1) ÷ 3 = 5
How does this calculator work?
The section formula finds point P dividing AB in ratio m:n. Internally: P = ((mx₂ + nx₁)/(m+n), (my₂ + ny₁)/(m+n)). Externally: replace + with − in numerator and denominator. The midpoint is the special case m = n = 1.
Formula
How this is calculated
The section formula locates the point P that divides the segment AB in the ratio m:n. For internal division, P lies between A and B: the x-coordinate is the weighted average (m·x₂ + n·x₁)/(m + n), and the y-coordinate follows the same pattern. Geometrically, AP:PB = m:n, meaning the first segment is m/(m+n) of the total length and the second is n/(m+n).
For external division, P lies on the extension of AB beyond one of the endpoints. The formula changes to (m·x₂ − n·x₁)/(m − n) for both coordinates. External division is undefined when m = n because the denominator is zero (the point would be at infinity on the line). A negative ratio in the external case indicates the point lies on the opposite side.
The section formula is a cornerstone of coordinate geometry: it generalises the midpoint formula (which is simply m = n = 1 for internal division), and underpins centroid calculations, trisection, and many computer graphics interpolation problems.
Frequently asked questions
When m = n = 1 the internal section formula gives ((x₁ + x₂)/2, (y₁ + y₂)/2), which is the standard midpoint formula. Any equal ratio (m = n) gives the midpoint for internal division.
External division means P lies outside the segment AB on the line through A and B — either beyond B (when m > n) or beyond A (when m < n). The ratio AP:PB still equals m:n but the signs of the segments are opposite because they point in different directions.
Yes. The formula works for any positive real ratio. For example m = 1.5, n = 0.5 gives P three-quarters of the way from A to B.
Also known as
TG we-Calculate Editorial Team. (2026). Ratios of Directed Line Segments Calculator — Section Formula [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/ratios-of-directed-line-segments-calculator
TG we-Calculate Editorial Team. "Ratios of Directed Line Segments Calculator — Section Formula." TG we-Calculate. 2026. https://we-calculate.com/calculator/ratios-of-directed-line-segments-calculator.
TG we-Calculate Editorial Team, "Ratios of Directed Line Segments Calculator — Section Formula," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/ratios-of-directed-line-segments-calculator
@misc{wecalculate_ratios_of_directed_line_segments_calculator, title = {Ratios of Directed Line Segments Calculator — Section Formula}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/ratios-of-directed-line-segments-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
