👉 In mathematics, a metric is a function that assigns to every pair of points in a space an absolute value or length. The absolute value is used to ensure that distances between points are positive real numbers. Metrics can be defined for any set of points and can also be used to measure the distance between two sets of points.