Virtually all sampling-based planning algorithms require a function that measures the distance between two points in . In most cases, this results in a metric space, which is introduced in Section 5.1.1. Useful examples for motion planning are given in Section 5.1.2. It will also be important in many of these algorithms to define the volume of a subset of . This requires a measure space, which is introduced in Section 5.1.3. Section 5.1.4 introduces invariant measures, which should be used whenever possible.