A distance function assigns each point a nonnegative separation from another point or geometric set. In geometry and computation, it turns shapes into scalar fields that algorithms can evaluate and reuse. section 2.8 section 10.1.4
For a plane defined by three noncollinear points, distance can be understood as the height of a parallelepiped: signed volume divided by the base parallelogram’s area. The same result comes from projecting onto the plane’s normalized normal. section 9.4.3
A signed distance function (SDF) extends ordinary distance with a sign: it is negative inside a body and positive outside. This convention describes both a shape’s boundary and its surrounding field. section 10.1
Common geometric distance constructions include:
- Point-to-point distance uses the Euclidean square-root formula, or an equivalent self-dot-product implementation. section 10.1.4
- Point-to-line distance divides a parallelogram’s signed area by the line segment’s length; its absolute value gives unsigned distance. section 10.1.4
- Point-to-segment distance checks the normalized projection: use the line distance for an interior projection and an endpoint distance otherwise. section 10.1.4
- A rectangle SDF combines distances to its four edges and assigns the sign from the nearest edge’s supporting line. section 10.1.4
Figure 9.20 A parallelepiped formed by p2-p1, p3-p2, and p-p1, and the parallelogram formed by p2-p1, p3-p1, too
Visualizes point-to-plane distance as the height of a parallelepiped over a parallelogram base. section 9.4.3
Shows an SDF for a disk, with negative values inside and positive values outside. section 10.1









