TernaryDistance function

Distance Between Points in Ternary Coordinates