The Attempt at a Solution
In 3d, things start going wrong. We can basically extend constraint (1) fairly trivially:
J=[ 0, 0, 0, x_{2}-x_{3}, y_{2}-y_{3}, z_{2}-z_{3}, x_{3}-x_2, y_3-y_2, z_3-z_2]
...but the collinear constraint is trickier (to me). So far my attempts have centred around...