programming maths Distance Functions (iquilezles.org) Distance functions for basic primitives and formulas for combining them together