Add function to return the violation of a distance constraint.

Make accessors constant functions.