Skip to content
Math

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.

Your details

Choose whether to find point P given a ratio, or find the ratio given three collinear points.
Internal division places P between A and B. External division places P on the line through A and B but outside the segment.
The x-coordinate of the starting point A.
The y-coordinate of the starting point A.
The x-coordinate of the terminal point B.
The y-coordinate of the terminal point B.
The first part of the ratio m:n (portion from A to P).
The second part of the ratio m:n (portion from P to B).
P: x-coordinate
2.2

The x-coordinate of the partitioning point P.

P: y-coordinate3.6
Ratio m2
Ratio n3
Ratio m:n0 : 0
Segment AB length5
AP length2
PB length3
Division typeInternal division
AP length2
PB length3
AB total length5

P = (2.2000, 3.6000) - Internal division in ratio 0 : 0

  • AP = 2.0000 units, PB = 3.0000 units, confirming a internal division in ratio 0 : 0.
  • The full segment AB has length 5.0000 units.
  • The section formula works for any ratio of positive real numbers. Use external division when the ratio is applied beyond the endpoint B.

Next stepThe midpoint of this segment is (2.5000, 4.0000). To trisect the segment, compute P with ratios 1:2 and 2:1.

Formula

Internal: P=(mx2+nx1m+n,  my2+ny1m+n)External: P=(mx2nx1mn,  my2ny1mn)\text{Internal: } P = \left(\frac{mx_2 + nx_1}{m+n},\; \frac{my_2 + ny_1}{m+n}\right) \qquad \text{External: } P = \left(\frac{mx_2 - nx_1}{m-n},\; \frac{my_2 - ny_1}{m-n}\right)

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:nLocation of PFraction from A
1:1Midpoint of AB1/2
1:2First trisection point (closer to A)1/3
2:1Second trisection point (closer to B)2/3
1:3Quarter point (closer to A)1/4
3:1Three-quarter point (closer to B)3/4
1:4One-fifth from A1/5
4:1Four-fifths from A4/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.

Sources

Written by Dr. Rajiv Menon, PhD Applied Mathematician · Bengaluru, India

Applied mathematician bridging algebraic theory and computational tools for students, engineers, and everyday problem-solvers.

Search 3,500+ calculators

Loading search…