How to Calculate Euclidean Distance

••• Antonio_Diaz/iStock/GettyImages

Euclidean distance is the distance between two points in Euclidean space. Euclidean space was originally devised by the Greek mathematician Euclid around 300 B.C.E. to study the relationships between angles and distances. This system of geometry is still in use today and is the one that high school students study most often. Euclidean geometry specifically applies to spaces of two and three dimensions. However, it can easily be generalized to higher order dimensions.

    Compute the Euclidean distance for one dimension. The distance between two points in one dimension is simply the absolute value of the difference between their coordinates. Mathematically, this is shown as |p1 - q1| where p1 is the first coordinate of the first point and q1 is the first coordinate of the second point. We use the absolute value of this difference since distance is normally considered to have only a non-negative value.

    Take two points P and Q in two dimensional Euclidean space. We will describe P with the coordinates (p1,p2) and Q with the coordinates (q1,q2). Now construct a line segment with the endpoints of P and Q. This line segment will form the hypotenuse of a right triangle. Extending the results obtained in Step 1, we note that the lengths of the legs of this triangle are given by |p1 - q1| and |p2 - q2|. The distance between the two points will then be given as the length of the hypotenuse.

    Use the Pythagorean theorem to determine the length of the hypotenuse in Step 2. This theorem states that c^2 = a^2 + b^2 where c is the length of a right triangle's hypotenuse and a,b are the lengths of the other two legs. This gives us c = (a^2 + b^2)^(1/2) = ((p1 - q1)^2 + (p2 - q2)^2)^(1/2). The distance between 2 points P = (p1,p2) and Q = (q1,q2) in two dimensional space is therefore ((p1 - q1)^2 + (p2 - q2)^2)^(1/2).

    Extend the results of Step 3 to three dimensional space. The distance between points P = (p1, p2, p3) and Q = (q1,q2,q3) can then be given as ((p1-q1)^2 + (p2-q2)^2 + (p3-q3)^2)^(1/2).

    Generalize the solution in Step 4 for the distance between two points P = (p1, p2, ..., pn) and Q = (q1,q2, ..., qn) in n dimensions. This general solution can be given as ((p1-q1)^2 + (p2-q2)^2 + ... + (pn-qn)^2)^(1/2).

Related Articles

How to Convert Square Dimensions to Round
How to Find Euclidean Distance
How to Calculate Square Feet in a Triangle
How to Size H-Beams
How to Calculate Ramp Length
How to Calculate the Area of an Equilateral Triangle
How to Find the Area of a Scalene Triangle
How to Calculate the Diagonal of a Triangle
How to Calculate a Tangent
How to Calculate the Diameter of a Circle From a Linear...
How to Calculate Ellipse Dimensions
How to Graph Exponential Functions, an Easy Way
How to Find the Radius of a Circle With the Midpoint
How to Calculate the Chord of a Circle
How to Calculate Perimeter and Area Ratio
How to Find the Lateral Area of a Square Pyramid
How to Write the equation of a Linear Function whose...
How to Calculate the Obtuse Triangle
How to Calculate the Length of an Arc
How to Calculate Relative Standard Error