A little context. A clearer answer.
When this calculator is useful
Form A=y2−y1, B=x1−x2 and C=Ax1+By1. The general equation Ax+By=C also represents vertical lines. When x coordinates differ, compute slope and the y intercept. The point distance uses the Euclidean formula. For a related calculation, try Linear regression and residuals.
What to enter
| Input | What it means | Example value |
|---|---|---|
| x₁ | Horizontal coordinate of the first point. x₁: -1000000…1000000 | 1 |
| y₁ | Vertical coordinate paired with that first x value. y₁: -1000000…1000000 | 2 |
| x₂ | Horizontal coordinate of the second point in the same coordinate system. x₂: -1000000…1000000 | 4 |
| y₂ | Vertical coordinate paired with the second x value. y₂: -1000000…1000000 | 8 |
How the calculation works
- Change the inputs to explore your own scenario. x₁: -1000000…1000000 ; y₁: -1000000…1000000 ; x₂: -1000000…1000000 ; y₂: -1000000…1000000 .
- A=y₂−y₁; B=x₁−x₂; C=Ax₁+By₁; Ax+By=C; m=−A/B
- Two distinct points define one infinite straight line. Repeated points are rejected. A vertical slope is undefined. A coincident axis has infinitely many intersections. The drawing uses a local coordinate window; it is not a regression fit.
A=y₂−y₁; B=x₁−x₂; C=Ax₁+By₁; Ax+By=C; m=−A/BA worked example
(1,2) and (4,8) → y=2x, slope 2, both axis intercepts 0, distance √45≈6.7082039325. Points (3,−1),(3,5) give x=3 and an undefined slope.
Example you can load
What to enterThis is a fixed example; changing the form above does not change these numbers.
Assumptions & limits
Two distinct points define one infinite straight line. Repeated points are rejected. A vertical slope is undefined. A coincident axis has infinitely many intersections. The drawing uses a local coordinate window; it is not a regression fit.
Frequently asked questions
Does the calculator fit a line to noisy data?
No. It constructs the exact line defined by two entered points. Use linear regression for a larger measured data set.
What happens for a vertical line?
The equation is x=constant. The slope is unavailable; intersection with the y axis is absent unless the line is the y axis itself.
Why are repeated points rejected?
One distinct point lies on infinitely many lines and cannot determine a unique equation.