10.1k views
1 vote
What is the distance formula

1 Answer

4 votes

It depends on what distance you want.

In 2 dimensions, the Pythagorean theorem gives a way to calculate the distance between two points based on their rectangular coordinates.

For points (x1, y1) and (x2, y2), the straight-line distance between them on the Cartesian coordinate plane is the root of the sum of the squares of the differences in coordinate values:

... d = √((x2 -x2)^2 + (y2 - y1)^2)

_____

In 3 (rectangular) dimensions, the formula is basically the same. You can think of it as calculating a face diagonal of the cuboid of which the space diagonal is the distance you want. The face diagonal together with the remaining edge form another right triangle to which this formula applies. The overall effect is

... d = √((x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2)

_____

Distances in other coordinate systems or along a curve have different formulas, though they're generally based on these.

User Jsnjack
by
5.7k points