JUMP TO TOPIC [show]
Euclidean Distance Calculator + Online Solver With Free Steps
The Euclidean Distance Calculator finds the Euclidean distance between any two real or complex n-dimensional vectors. Both vectors must have equal dimensions (number of components).
The calculator supports any-dimensional vectors. That is, n can be any positive integer, and the input vector can exceed 3-dimensions. However, such high-dimensional vectors are not visualizable.
Variable entries within a vector are also supported. That is, you may enter a vector
What Is the Euclidean Distance Calculator?
The Euclidean Distance Calculator is an online tool that calculates the Euclidean distance between two n-dimensional vectors
The calculator interface consists of two vertically stacked input text boxes. Each text box corresponds to a single vector of n-dimensions.
Both the vectors must be in Euclidean or complex space, and
Where
How To Use the Euclidean Distance Calculator
You can use the Euclidean Distance Calculator to find the Euclidean distance between any two vectors
For example, let us assume we want to find the euclidean distance between the two vectors:
Step 1
Ensure both vectors have equal dimensions (number of components).
Step 2
Enter the first vector’s components into either the first or second text box as “5, 3, 4” without commas.
Step 3
Enter the second vector’s components into the other text box as “4, 1, 2” without commas.
Step 4
Press the Submit button to get the resulting Euclidean distance:
The order in which you enter the vectors does not matter because the Euclidean distance involves the square of the difference between corresponding vector components. This automatically removes any negative signs so
Entering Complex Vectors
If any one component of an n-dimensional vector is complex, that vector is said to be defined in the complex space
For example, in
Results
Non-variable Inputs
If all the components are defined, constant values belonging to
Variable Inputs
If the input contains any characters other than “i” (treated as iota i) or a combination of letters corresponding to a mathematical constant such as “pi” (treated as
For example, let us say we want to enter
- The first result is the most general form and has the modulus operator on all variable terms.
- The second result assumes that the variables are complex and performs the modulus operation on each difference component before squaring.
- The third result assumes that the variables are real and contain the square of the difference of variable terms with other components.
Plots
If a minimum of one and a maximum of two variables are present in the input, the calculator will also plot some graphs.
In the case of one variable, it plots the 2D graph with distance along the y-axis and variable value along the x-axis. In the case of two variables, it plots the 3D graph and its equivalent contour plot.
How Does the Euclidean Distance Calculator Work?
The calculator works by using the generalized distance formula. Given any two vectors:
The Euclidean distance is then given as:
Essentially, the calculator uses the following general equation:
Where pi and qi represent the i component of the vectors
Euclidean distance can also be thought of as the L2 norm of the difference vector
For complex corresponding components a+bi in
Where
Solved Examples
Example 1
Find the Euclidean distance between the two vectors:
Show that it is equal to the L2 norm of the difference vector
Solution
The L2 norm of
Thus, if
Example 2
Consider the two complex vectors:
Calculate the distance between them.
Solution
Since we have complex vectors, we must use the square of the modulus (indicated by|a|) of each component’s difference.
The modulus is simply the square root of squared sum of the real and imaginary parts so:
Which gets us:
Example 3
Find the Euclidean distance between the following high-dimensional vectors with variable components:
Solution
We have two variables x and y. The Euclidean distance is given as:
Since the variables may be complex, the general result is given by the calculator as:
The second result assumes variables are complex and gives:
Let z be a complex number such that:
Thus, our expression for Euclidean distance becomes:
Applying modulus:
The third result assumes the variables are real, and replaces the modulus operator with parentheses:
The graph (in orange) of the Euclidean distance (blue axis) above as a function of x (red axis) and y (green axis) is given below:

Figure 1
All images/plots were created using GeoGebra.