How the Ratios of Directed Line Segments Calculator works
Given three collinear points A, B, and P, this calculator finds the ratio AP:PB in which P divides the directed segment from A to B. Unlike an ordinary distance ratio, AP and PB are directed (signed) lengths — they carry direction along the line, so the ratio can be positive or negative depending on whether P sits between A and B or outside that segment. This is the inverse of the classic section formula: instead of computing a point from a known ratio, it computes the ratio from a known point.
Formula and derivation
Write P as a point on the line through A(x₁, y₁) and B(x₂, y₂): P = A + t(B − A) for some scalar t. Solving for t using both coordinates (a projection onto the AB direction) gives t = [(x − x₁)(x₂ − x₁) + (y − y₁)(y₂ − y₁)] / [(x₂ − x₁)² + (y₂ − y₁)²]. Since AP = t·|AB| and PB = (1 − t)·|AB|, the directed ratio is k = AP/PB = t/(1 − t), written as AP:PB = k:1. When 0 < t < 1, P lies between A and B and k is positive (internal division). When t < 0 or t > 1, P lies outside segment AB on the extended line and k is negative (external division). Before reporting a ratio, the calculator verifies A, B, and P are collinear by checking that the perpendicular distance from P to line AB is (near) zero — if P is off the line, no directed ratio exists.
Common mistakes
- Using unsigned distances: a plain distance ratio |AP|:|PB| is always positive and cannot distinguish internal from external division — the directed ratio keeps the sign to preserve that information.
- Assuming P is on the line: if A, B, and P are not exactly collinear (a rounding error or a mistyped coordinate), the ratio AP:PB is undefined; always confirm the collinearity check passes.
- Mixing up A and B: AP:PB is not the same as PA:PB or BP:AP — swapping the reference points inverts or negates the ratio, so keep A, B, and P consistent with your diagram.
Real-world applications
- Analytic geometry problems that ask "in what ratio does point P divide segment AB" — common when verifying a given point against the section formula.
- Computer graphics and CAD, where directed ratios locate a point along a segment or extend a line to a control point outside the original endpoints.
- Physics and engineering, such as finding the ratio in which a support or load point divides a beam, using signed positions along the beam's axis.
- Checking whether three points are collinear and, if so, characterizing their order on the line (between the endpoints versus beyond one of them).