Directed Line Segment Ratio Calculator

Find the point P that divides a line segment AB in a given ratio m:n using the section formula.

Enter Endpoints & Ratio

Result

Point P dividing AB in ratio m:n
--
Point A--
Point B--
Ratio m:n--
P(x)--
P(y)--
Distance AP--
Distance PB--
Distance AB--

Step-by-Step Solution

P = ((mx2 + nx1)/(m+n), (my2 + ny1)/(m+n))

The Section Formula

The section formula is used to find the coordinates of a point that divides a line segment joining two points in a given ratio. If point P divides the line segment from A(x1, y1) to B(x2, y2) in the ratio m:n, then the coordinates of P are given by:

Internal Division

Point P lies between A and B.

P = ((mx2 + nx1)/(m+n), (my2 + ny1)/(m+n))

Midpoint (Special Case)

When m:n = 1:1, P is the midpoint of AB.

M = ((x1+x2)/2, (y1+y2)/2)

External Division

Point P lies outside AB. Use negative ratio for external division.

P = ((mx2 - nx1)/(m-n), (my2 - ny1)/(m-n))

Directed Line Segments

A directed line segment has a specific direction from one endpoint to another. The direction matters when computing ratios because dividing AB in the ratio 2:3 from A is different from dividing BA in the ratio 2:3 from B. The section formula always measures the ratio from the first point (A) toward the second point (B).

Applications

  • Computer Graphics: Finding points along lines for interpolation and animation.
  • Navigation: Computing waypoints along a route at specific fractions of the total distance.
  • Engineering: Locating specific points on structural elements.
  • Geometry: Finding centroids, incenters, and other special points in triangles.

Verification

To verify the result, check that the ratio AP:PB equals m:n. You can compute the distances AP and PB using the distance formula and confirm their ratio matches the given m:n.