Algebra
Distance between the two points
The straight-line separation, from Pythagoras. Related to slope but answering a different question.
Last updated
The Formula
d = sqrt((x2 - x1)^2 + (y2 - y1)^2)
The straight-line separation, from Pythagoras. Related to slope but answering a different question.
| Symbol | Meaning | Unit | Notes |
|---|---|---|---|
| d | Straight-line distance | same as coordinates | Independent of which point you call first, because both differences are squared. |
What Each Symbol Means
dsame as coordinates
Straight-line distance
Independent of which point you call first, because both differences are squared.
See It Worked With Real Numbers
A formula on its own does not tell you which number goes where. The how to calculate slope page applies this equation to a concrete case, shows every intermediate step, and names the mistakes that produce a wrong answer even when the algebra is right.
Where This Formula Appears
This equation is the working core of How To Calculate Slope, filed under Math. Every number the guide produces comes from substituting into this one line.
Common Questions
What is the formula for Distance between the two points?
The formula for Distance between the two points is d = sqrt((x2 - x1)^2 + (y2 - y1)^2). The straight-line separation, from Pythagoras. Related to slope but answering a different question.
What units should I use with Distance between the two points?
Substitute d in same as coordinates. Convert every input to those units before you start, because the equation only returns the right answer when the units on both sides agree.
What is a common mistake when using Distance between the two points?
Assuming all lines have a slope. Vertical lines do not — the run is zero and the division cannot be performed. Saying the slope is infinite is a useful shorthand but mathematically it is undefined.