# Mahalanobis distance

The Mahalanobis distance measures the distance between a point and a distribution. Here are several examples,

We have a scalar, and a collection of scalars. The distance between the one number and the rest of the numbers is the Mahalanobis distance.

We have a point, and a collection of points. The distance between the point and the collection of points is the Mahalanobis distance.

We have a vector matrix, and a two-dimensional matrix. A vector matrix consists of only one column or only one row, and the two-dimensional matrix must have one side with the same size as the vector. For example, the Mahalanobis distance may be calculated between a vector matrix with one row and five columns, and a matrix with ten rows and five columns.

The Mahalanobis distance is equal to zero when the point is equal to the mean of the distribution.