programming maths Distance Functions Distance functions for basic primitives and formulas for combining them together