1, d(A, A)=0// The distance to yourself is 0.
2. d(A, B)>=0// The distance is not negative.
3.d(A, B)=d(B, A)// Symmetry: If the distance from A to B is A, then the distance from B to A should also be A.
4. d(A, C)+d(C, B)>=d(A, B)// Triangle rule: (the sum of two sides is greater than the third side).
In mathematics, distance is one of the most basic concepts in functional analysis. The distance space defined by it connects topological space with normed linear space and other spaces, and it is the first contact concept of learning functional analysis. Matlab mainly uses pdist function to calculate the distance. If x is an M×N matrix, pdist(X) takes each of the m rows of the x matrix as an n-dimensional vector, and then calculates the distance between the m vectors.