Skip to content
FiftyCalc Free calculators for all 50 states

Directed Line Segment Calculator

Test cases replayed : 2 of 2 match · Methodology · No outside source listed

Enter the coordinates of the start point A and end point B, and the ratio m:n in which P splits the segment from A toward B.

Result

Sample figures

P: x = x₁ + m/(m + n) × (x₂ − x₁)—

P: y = y₁ + m/(m + n) × (y₂ − y₁) —

  • Share of the way from A to B—
  • Length AP—
  • Length PB—

Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.

Directed Line Segment Calculator

A: x₁: enter a number. Prefilled example: 1.

A: y₁: enter a number. Prefilled example: 2.

B: x₂: enter a number. Prefilled example: 7.

B: y₂: enter a number. Prefilled example: 8.

Ratio part m (from A to P): enter 0 or more. Prefilled example: 1.

Ratio part n (from P to B): enter 0 or more. Prefilled example: 2.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. A: x₁: enter a number.
  2. A: y₁: enter a number.
  3. B: x₂: enter a number.
  4. B: y₂: enter a number.
  5. Ratio part m (from A to P): enter 0 or more.
  6. Ratio part n (from P to B): enter 0 or more.
  7. Read the result: P: x = x₁ + m/(m + n) × (x₂ − x₁); the panel also shows P: y = y₁ + m/(m + n) × (y₂ − y₁), Share of the way from A to B, Length AP and Length PB.

How this calculator works

Section formula (internal division): the point P that divides the directed segment AB so that AP : PB = m : n is P = ((n x₁ + m x₂) ÷ (m + n), (n y₁ + m y₂) ÷ (m + n)), the same as moving the fraction m/(m + n) of the way from A to B.

The direction matters: dividing from B to A in the ratio m:n gives a different point (the one for n:m from A).

The formula

  1. Px=x1+mm+n×(x2−x1)
Symbols used in the formula
SymbolMeaning
x1A: x₁
x2B: x₂
mRatio part m (from A to P)
nRatio part n (from P to B)
PxP: x = x₁ + m/(m + n) × (x₂ − x₁)

Worked example

A: x₁1
A: y₁2
B: x₂7
B: y₂8
Ratio part m (from A to P)1
Ratio part n (from P to B)2
P: y = y₁ + m/(m + n) × (y₂ − y₁)4
Share of the way from A to B33.33%
Length AP2.8284
Length PB5.6569
  1. Px=1+11+2×(7−1)=3

P: x = x₁ + m/(m + n) × (x₂ − x₁) 3

Each step uses the unrounded value of the step before it; figures on this page are rounded for display.

Frequently asked questions

Which point divides A(1, 2) to B(7, 8) in the ratio 1:2?

P = (1 + ⅓ × 6, 2 + ⅓ × 6) = (3, 4).

What ratio gives the midpoint?

1:1, which puts P halfway (50%) from A to B.

Questions answered

Related calculators