👉 In mathematics, a metric is a function that assigns to every pair of points in a set (such as a group, or a set of objects) a real number. This real number is called a metric value and it can be used to measure distances between points in the set. For example, if we have two points A and B in a set S, then we can define a metric function d(A,B) that measures the distance between them as follows: d(A,B) = |A