In mathematics, convex metric spaces are, intuitively, metric spaces with the property any "segment" joining two points in that space has other points in it besides the endpoints.
Formally, consider a metric space (X, d) and let x and y be two points in X. A point z in X is said to be between x and y if all three points are distinct, and
that is, the triangle inequality becomes an equality. A convex metric space is a metric space (X, d) such that, for any two distinct points x and y in X, there exists a third point z in X lying between x and y.
Metric convexity:
Let be a metric space (which is not necessarily convex). A subset of is called a metric segment between two distinct points and in if there exists a closed interval on the real line and an isometry