Planarity constraints on squared distances #
Three exact identities carry all of the geometry in this project. Each is a polynomial
identity in the coordinates of the points involved, so each is proved by ring.
four_mul_mul_sub_sq_eqis Heron's formula in squared-distance form. Its corollarysq_le_four_mulis the triangle inequality written without square roots, and it is the only inequality the classification of chain triangles needs.gramDet_eq_zerosays that the doubled Gram matrix of three plane vectors anchored at a fourth point is singular. Expressed in the six squared distances of four points this is the Cayley--Menger relation, and it is the only equation the four-point catalogue needs.gram3_det_eq_zerois the same singularity written directly in inner products; together withsq_nonneg_comboit supplies the five-point obstruction.
Heron's formula in squared-distance form: the Cayley--Menger expression of a triangle is four times the square of its doubled signed area.
Three vectors of the plane are linearly dependent, so the anchored Gram determinant of any four plane points vanishes. This is the Cayley--Menger relation for four coplanar points.
The Gram determinant of three plane vectors vanishes.
The squared length of a linear combination of four plane vectors is nonnegative, expanded in inner products.