Distância entre Vetores

|u−v| = √Σ(uᵢ−vᵢ)².
Created by
Renato Passos, Eng. de Software
Reviewed by
Renato Passos, Eng. de Software

Last updated: Apr 18, 2026

|u−v|
5,0000

Formula

euclidiana

About this calculator

The vector distance calculator computes the Euclidean distance between two vectors in n-dimensional space. Euclidean distance is the most common geometric distance measure between two points, representing the length of the straight line segment connecting them. The formula used is: d(u, v) = √(Σ(uᵢ − vᵢ)²), where u and v are vectors with coordinates (u₁, u₂, ..., uₙ) and (v₁, v₂, ..., vₙ). The result is always a non-negative number.

To use the calculator, enter the coordinates of the two vectors separated by commas, one per line or in specific fields. The tool automatically computes the sum of squared differences and extracts the square root. For example, for two-dimensional vectors u=(1,2) and v=(4,6), the distance is √((1−4)²+(2−6)²) = √(9+16) = √25 = 5. The calculator supports vectors of any dimension, as long as both have the same number of coordinates.

This calculator is useful in various fields: analytic geometry, for calculating distances between points; machine learning, for measuring similarity between samples (e.g., in KNN algorithm); physics, for computing displacement or magnitude of difference vectors; and signal processing, for comparing signals. It is especially valuable in problems requiring quantitative comparison of multidimensional data.

Important precautions: ensure the vectors have the same dimensionality. Euclidean distance is sensitive to scales: if coordinates are in different units (e.g., meters and kilograms), the distance may be distorted. In such cases, consider normalizing the data. Also, Euclidean distance assumes independence between dimensions; if there is correlation, other metrics (like Mahalanobis) may be more appropriate.

Frequently asked questions

What does Euclidean distance mean?

It is the straight-line distance between two points in space, calculated as the square root of the sum of squared differences between their coordinates.

Can I calculate distance between vectors of different sizes?

No, both vectors must have the same number of coordinates (same dimensionality) for the calculation to be valid.

What is the difference between Euclidean and Manhattan distance?

Euclidean distance measures the straight line, while Manhattan distance sums the absolute differences of coordinates (grid distance).

Does Euclidean distance work for categorical data?

No, it is suitable only for continuous numerical data. For categorical data, use other metrics like Hamming distance.

How does data scaling affect Euclidean distance?

Variables with larger scales dominate the calculation. It is recommended to normalize or standardize the data before computing distance.

Other Algebra Linear calculators