Vector Distance Calculator

Calculate the distance between two vectors using the Euclidean distance formula. Enter two vectors with the same number of components to find their distance in 2D, 3D, or higher-dimensional space.

The calculator also provides Manhattan and Chebyshev distances, along with component differences, squared differences, and a step-by-step explanation.

Enter two vectors

Enter the components of both vectors in the same order.

Example: (3, 4) or 3, 4, 5
Both vectors must have the same number of components.

What is the distance between two vectors?

The distance between two vectors measures how far apart they are in a vector space. It is calculated by subtracting one vector from the other and finding the magnitude of the resulting difference vector.

For two vectors with the same number of components, the Euclidean distance represents the straight-line distance between their corresponding points.

Distance = magnitude of the difference vector
d(A, B) = ||A − B||

Euclidean distance formula

The Euclidean distance is the standard straight-line distance between two vectors. For vectors in n-dimensional space, subtract corresponding components, square the differences, add them, and take the square root.

d(A, B) = √[(a₁ − b₁)² + (a₂ − b₂)² + ... + (aₙ − bₙ)²]

The formula works in two dimensions, three dimensions, and higher-dimensional Euclidean spaces.

Example 1: Distance between two 2D vectors

Find the distance between A = (3, 4) and B = (0, 0).

d(A, B) = √[(3 − 0)² + (4 − 0)²]
= √(9 + 16)
= √25
= 5

The Euclidean distance is 5.

Example 2: Distance between two 3D vectors

Find the distance between A = (1, 2, 3) and B = (4, 6, 3).

d(A, B) = √[(1 − 4)² + (2 − 6)² + (3 − 3)²]
= √[(-3)² + (-4)² + 0²]
= √(9 + 16 + 0)
= √25
= 5

The distance between the vectors is 5.

Other vector distance metrics

Manhattan distance

Manhattan distance is the sum of the absolute differences between corresponding components. It is also known as L1 distance or taxicab distance.

d₁(A, B) = Σ |aᵢ − bᵢ|

It measures distance by adding the individual coordinate movements rather than taking a straight-line path.

Chebyshev distance

Chebyshev distance is the largest absolute component difference. It is also known as L-infinity distance.

d∞(A, B) = max |aᵢ − bᵢ|

It is useful when distance is determined by the largest coordinate difference, such as movement where multiple coordinates can change simultaneously.

Properties of Euclidean distance

Frequently asked questions

1. How do you calculate the distance between two vectors?

Subtract corresponding components, square each difference, add the squares, and take the square root. This produces the Euclidean distance.

2. What is the formula for Euclidean distance?

The formula is d(A, B) = √Σ(aᵢ − bᵢ)², where aᵢ and bᵢ are corresponding components of the two vectors.

3. Can I calculate distance between 3D vectors?

Yes. Enter three components for each vector. The calculator subtracts the x, y, and z coordinates and applies the Euclidean distance formula.

4. Can vectors have more than three dimensions?

Yes. Euclidean distance works in any finite-dimensional coordinate space. This calculator supports vectors with two through eight components.

5. What is Manhattan distance?

Manhattan distance is the sum of the absolute differences between corresponding components. It is also called L1 distance.

6. What is Chebyshev distance?

Chebyshev distance is the largest absolute difference between corresponding vector components. It is also called L-infinity distance.

7. Can the distance between different vectors be zero?

No. Euclidean distance is zero only when every component of the two vectors is equal.

8. Is vector distance the same as vector magnitude?

They are related but not identical. Vector magnitude measures the length of one vector from the origin. Distance measures the separation between two vectors, or equivalently the magnitude of their difference.

9. Does the order of the two vectors matter?

No. Euclidean distance is symmetric, so the distance from A to B is the same as the distance from B to A.

Related vector and matrix calculators