Polygonal equalities and $p$-negative type