Ratios Of Directed Line Segments - Section Formula, Internal & External

Use this ratios of directed line segments calculator to find the point P that splits AB in any ratio m:n, with internal and external modes and signed distances.

Updated: June 18, 2026 • Free Tool

Ratios Of Directed Line Segments

x-coordinate of endpoint A on the directed line segment.

y-coordinate of endpoint A on the directed line segment.

x-coordinate of endpoint B on the directed line segment.

y-coordinate of endpoint B on the directed line segment.

Ratio weight m that pairs with endpoint B in the section formula.

Ratio weight n that pairs with endpoint A. For external division, m and n must differ to avoid divide-by-zero.

Internal division places P on the segment AB; external division places P on the line extension beyond A or B.

Results

Point P x-coordinate
0units
Point P y-coordinate 0units
Signed distance AP 0units
Signed distance PB 0units
Segment length AB 0units

What Are Ratios of Directed Line Segments?

Ratios of directed line segments describe how a point P splits an oriented segment from A to B in a chosen proportion m:n, and the section formula returns the exact coordinates of P for both modes.

  • Coordinate geometry homework: Find the point that divides a segment in a stated ratio without expanding the section formula by hand.
  • Centroid and trisection problems: Use the m:n = 1:1 reduction to recover the midpoint, or 1:2 and 2:1 to locate the two trisection points.
  • Vector decomposition: Treat the section formula as a weighted combination of two position vectors, which mirrors how vector bases split a segment.
  • CAD and mapping workflows: Locate a probe point along a survey line or tool path on a design segment at a known proportion.

Direction matters because the ratio m:n is measured along the A-to-B orientation. Flip A and B and the same numeric ratio describes a different division. The page defaults to internal division so P lands on AB; switch to external for P past one endpoint.

When you also need the Euclidean distance between the same endpoints, Length of a Line Segment Calculator returns AB and the midpoint alongside the section formula result.

How the Section Formula Works

The section formula is a weighted average of the two endpoint coordinates. Pick a mode, supply m and n, and the calculator updates P and the signed distances as you type. Ratios of directed line segments are read this way: Px and Py are weighted averages of x1 with weight n and x2 with weight m for internal division.

Internal: P = ((m*x2 + n*x1)/(m+n), (m*y2 + n*y1)/(m+n)); External: P = ((m*x2 - n*x1)/(m-n), (m*y2 - n*y1)/(m-n))
  • x1, y1: Coordinates of endpoint A. Together they form the start of the directed segment.
  • x2, y2: Coordinates of endpoint B. The direction is always from A to B in this calculator.
  • m, n: Non-negative ratio weights. Internal mode uses plus signs and divides by m+n; external mode uses minus signs and divides by m-n.
  • Px, Py: Coordinates of the dividing point P. Internal mode places P between A and B; external mode places P on the extension.
  • AB: Full Euclidean length of the original segment, kept as a reference for the signed distances.

Switching from internal to external mode replaces plus signs with minus signs and m+n with m-n. Signed AP and PB outputs preserve direction so you can tell at a glance whether P is between A and B, beyond A, or beyond B.

Worked example: internal division of AB in the ratio 2:3

A(1, 2), B(4, 6), m = 2, n = 3, internal mode.

Px = (2*4 + 3*1) / (2+3) = 11/5 = 2.2; Py = (2*6 + 3*2) / 5 = 18/5 = 3.6.

P = (2.2, 3.6). Signed AP ≈ 2.00, signed PB ≈ 3.00, AB = 5.00.

P is two-fifths of the way from A toward B, and AP + PB equals the segment length.

Worked example: external division in the same ratio

A(1, 2), B(4, 6), m = 2, n = 3, external mode.

Px = (2*4 - 3*1) / (2-3) = 5 / -1 = -5; Py = (2*6 - 3*2) / -1 = 6 / -1 = -6.

P = (-5, -6). Signed AP ≈ -10.00, signed PB ≈ 15.00, AB = 5.00.

P sits past A opposite B. Signed AP is negative because P lies 10 units behind A in the A-to-B direction; signed PB stays positive.

According to Wikipedia, the section formula gives the coordinates of a point that divides a line segment internally or externally in a given ratio, and reduces to the midpoint when the ratio is 1:1.

According to Wolfram MathWorld, a line segment is a closed interval corresponding to a finite portion of an infinite line, written AB for endpoints A and B.

For the special case m = n = 1, Midpoint Calculator reproduces the midpoint from the same (x1, y1) and (x2, y2) inputs without changing the coordinate frame.

Key Concepts Explained

Four ideas show up every time you split a directed segment.

Directed vs undirected segments

A directed segment AB carries orientation from A to B. The same ratio m:n describes different points depending on which endpoint is the start, so A is fixed as the source and B as the destination.

Internal vs external division

Internal division places P on the segment so AP and PB are both positive and AP + PB = AB. External division places P on the extension so one signed distance becomes negative.

Section formula as a weighted average

Px and Py are weighted averages of the endpoints with weights n and m for internal division. Larger m pulls P toward B; larger n pulls P toward A.

Midpoint as the 1:1 case

Setting m = n = 1 collapses the section formula to the midpoint, so the midpoint is the 1:1 case of the more general rule.

To verify that AP + PB equals AB for collinear points, Segment Addition Postulate Calculator adds three collinear segments and shows the additive relationship.

How to Use This Calculator

Pick the mode, enter the endpoints, set the ratio weights, and read the signed distances. The page handles any ratios of directed line segments you can express as m:n by switching the section formula between its internal and external forms.

  1. 1 Pick the division mode: Choose Internal to put P on segment AB, or External to put P on the line extension. The mode controls which sign pattern the section formula uses.
  2. 2 Enter endpoint A: Type the x and y coordinates of A in the first pair. The defaults (1, 2) give a quick internal 2:3 example to verify the formula.
  3. 3 Enter endpoint B: Type the x and y coordinates of B in the second pair. The defaults (4, 6) pair with A(1, 2) for an AB length of 5 units.
  4. 4 Set the ratio weights m and n: Type the two ratio weights. For external mode, keep m and n different so the denominator m-n stays non-zero.
  5. 5 Read the point P and the signed distances: Px and Py appear at the top of the results panel. Signed AP and PB show how far P is along the A-to-B direction, with negative values flagging external placement.
  6. 6 Reset and try another ratio: Press Reset to restore the defaults and compare several ratios side by side.

Suppose you need the trisection points of a segment from (0, 0) to (9, 6). Internal mode with m = 1, n = 2 gives the first point at (3, 2); flip to m = 2, n = 1 for the second at (6, 4).

For the reverse problem - one endpoint, the midpoint, and a ratio are given, and the other endpoint is missing - Endpoint Calculator solves for the missing coordinate without re-deriving the section formula.

Benefits of Using This Calculator

These benefits come from real coordinate-geometry and drafting work.

  • Two endpoints and a ratio in, full geometry out: Enter A, B, and m:n once and the page returns P, signed AP, signed PB, and segment length AB without separate calculations.
  • Handles internal and external division in one place: The mode selector toggles between the plus-sign and minus-sign variants of the section formula.
  • Signed distances make direction visible: AP and PB keep their sign, so external placements past A or B show up as negative values.
  • Pairs with the midpoint and segment-length tools: Setting m = n = 1 reproduces the midpoint formula, and AB matches the length-of-a-line-segment tool.
  • Catches the m = n divide-by-zero case: External mode refuses m = n with a clear error instead of producing Infinity or NaN, keeping homework and CAD scripts safe.
  • Real-time updates as you type: Every change to A, B, m, or n refreshes the point and signed distances for sensitivity checks.

In practice, the page folds ratios of directed line segments into a single reading: P plus signed AP, signed PB, and AB sit on the same panel, so the placement can be sanity-checked at a glance.

For an unreduced ratio like 4:6 or 10:15, Ratio Calculator returns the simplest integer form first so the m:n pair is easy to read alongside the signed distances.

Factors That Affect Your Results

These factors determine whether the output matches the placement you expect on a drawing or in a homework step.

Choice of which endpoint is A

The directed segment runs from A to B. Swapping A and B keeps the ratio magnitude but flips the point, so always confirm A is the source endpoint before reading the signed distances.

Internal vs external mode

Internal mode uses plus signs and divides by m+n; external mode uses minus signs and divides by m-n. Picking the wrong mode moves P from inside the segment to the extension and flips signed AP for that case.

Ratio weights m and n

Larger m pulls P toward B; larger n pulls P toward A. The internal ratio m/(m+n) is the fraction of AB measured from A, so it is the easiest way to read the placement without computing P first.

Equal endpoints

When A equals B, the segment length is zero, the unit direction vector is undefined, and P equals A for any ratio. Signed AP and PB both read zero in this degenerate case.

Numerical precision of the inputs

Px, Py, signed AP, signed PB, and AB display four decimal places for typical magnitudes; higher input precision generally yields higher output precision.

  • External mode requires m and n to be different. If you enter m = n in external mode the calculator shows an error rather than attempting a divide-by-zero calculation.
  • The signed distances assume a flat Euclidean plane. On a curved surface such as a sphere the section formula is no longer the right tool and the result will not match a great-circle partition.

Treat ratios of directed line segments as exact analytic values in a flat plane. For geographic partitions the section formula treats the surface as Euclidean, so switch to a great-circle-aware tool.

According to the OpenStax Intermediate Algebra textbook on LibreTexts, the distance formula d = sqrt((x2-x1)^2 + (y2-y1)^2) gives the Euclidean length between two coordinate endpoints, matching the segment length AB the calculator returns for the directed segment from A to B.

When the same ratio appears as 4:6 or 10:15 instead of 2:3, Equivalent Ratio Calculator reduces it to the simplest integer form so the section formula reads cleanly.

ratios of directed line segments calculator showing endpoints A and B and a dividing point P labeled with the section formula and ratio m:n
ratios of directed line segments calculator showing endpoints A and B and a dividing point P labeled with the section formula and ratio m:n

Frequently Asked Questions

Q: What is a directed line segment?

A: A directed line segment is a line segment AB that carries an orientation from A to B. The direction matters because the ratio m:n is measured along that direction, and the dividing point P is computed using A as the starting endpoint and B as the destination.

Q: How do you divide a line segment internally in the ratio m:n?

A: Use the internal section formula P = ((m*x2 + n*x1)/(m+n), (m*y2 + n*y1)/(m+n)) with A(x1, y1) and B(x2, y2). The result P lies between A and B and the signed distances AP and PB are both positive and add up to the full segment length.

Q: How do you divide a line segment externally in the ratio m:n?

A: Use the external section formula P = ((m*x2 - n*x1)/(m-n), (m*y2 - n*y1)/(m-n)) with the same endpoints. The result P lies on the line beyond A or B, the denominator m-n must not be zero, and the signed AP is negative when P is on the A-side extension.

Q: What is the section formula?

A: The section formula is the closed-form expression that gives the coordinates of a point dividing a line segment AB in a given ratio m:n. Internal division uses plus signs in the numerator and denominator m+n; external division uses minus signs in the numerator and denominator m-n.

Q: What is the difference between internal and external division?

A: Internal division places the dividing point P between A and B, so the signed distances AP and PB are both positive. External division places P on the line extension beyond A or beyond B, so one signed distance becomes negative and the denominator switches from m+n to m-n.

Q: Why does the midpoint use the 1:1 ratio in the section formula?

A: Setting m = n = 1 collapses the internal section formula to P = ((x1+x2)/2, (y1+y2)/2), which is the midpoint of the segment. The same 1:1 case is the building block for the centroid of a triangle and for the medial triangle construction.