formal definition in Riemannian manifolds (using a Surface as an example.
More generally, it can be defined as a Metric in some space.