calc triangle dist