How can I select three distinct points are not collinear?

I have a list

list = {{{1, 8, 7}, {2, 5, 4}, {3, 2, 1}}, {{1, 8, 7}, {2, 5, 4}, {3, 7,
5}}, {{1, 8, 7}, {2, 5, 4}, {5, 6, 3}}, {{1, 8, 7}, {2, 5, 4}, {7,
5, 1}}, {{1, 8, 7}, {2, 5, 4}, {8, 7, 2}}, {{1, 8, 7}, {3, 2,
1}, {3, 7, 5}}, {{1, 8, 7}, {3, 2, 1}, {5, 6, 3}}, {{1, 8, 7}, {3,
2, 1}, {7, 5, 1}}, {{1, 8, 7}, {3, 2, 1}, {8, 7, 2}}, {{1, 8,
7}, {3, 7, 5}, {5, 6, 3}}, {{1, 8, 7}, {3, 7, 5}, {7, 5, 1}}, {{1,
8, 7}, {3, 7, 5}, {8, 7, 2}}, {{1, 8, 7}, {5, 6, 3}, {7, 5,
1}}, {{1, 8, 7}, {5, 6, 3}, {8, 7, 2}}, {{1, 8, 7}, {7, 5, 1}, {8,
7, 2}}, {{2, 5, 4}, {3, 2, 1}, {3, 7, 5}}, {{2, 5, 4}, {3, 2,
1}, {5, 6, 3}}, {{2, 5, 4}, {3, 2, 1}, {7, 5, 1}}, {{2, 5, 4}, {3,
2, 1}, {8, 7, 2}}, {{2, 5, 4}, {3, 7, 5}, {5, 6, 3}}, {{2, 5,
4}, {3, 7, 5}, {7, 5, 1}}, {{2, 5, 4}, {3, 7, 5}, {8, 7, 2}}, {{2,
5, 4}, {5, 6, 3}, {7, 5, 1}}, {{2, 5, 4}, {5, 6, 3}, {8, 7,
2}}, {{2, 5, 4}, {7, 5, 1}, {8, 7, 2}}, {{3, 2, 1}, {3, 7, 5}, {5,
6, 3}}, {{3, 2, 1}, {3, 7, 5}, {7, 5, 1}}, {{3, 2, 1}, {3, 7,
5}, {8, 7, 2}}, {{3, 2, 1}, {5, 6, 3}, {7, 5, 1}}, {{3, 2, 1}, {5,
6, 3}, {8, 7, 2}}, {{3, 2, 1}, {7, 5, 1}, {8, 7, 2}}, {{3, 7,
5}, {5, 6, 3}, {7, 5, 1}}, {{3, 7, 5}, {5, 6, 3}, {8, 7, 2}}, {{3,
7, 5}, {7, 5, 1}, {8, 7, 2}}, {{5, 6, 3}, {7, 5, 1}, {8, 7, 2}}}


I tried

Select[list, MatrixRank[#[[1]], #[[2]], #[[3]]] == 2 &]


I get the empty set.

• Your "Select" function has wring syntax. Try: Select[list, MatrixRank[#] == 3 &] Commented Jan 4 at 14:09

result=Pick[list, Not@*CollinearPoints /@ list]


{{{1, 8, 7}, {2, 5, 4}, {3, 7, 5}}, {{1, 8, 7}, {2, 5, 4}, {5, 6, 3}}, {{1, 8, 7}, {2, 5, 4}, {7, 5, 1}}, {{1, 8, 7}, {2, 5, 4}, {8, 7, 2}}, {{1, 8, 7}, {3, 2, 1}, {3, 7, 5}}, {{1, 8, 7}, {3, 2, 1}, {5, 6, 3}}, {{1, 8, 7}, {3, 2, 1}, {7, 5, 1}}, {{1, 8, 7}, {3, 2, 1}, {8, 7, 2}}, {{1, 8, 7}, {3, 7, 5}, {8, 7, 2}}, {{1, 8, 7}, {5, 6, 3}, {8, 7, 2}}, {{1, 8, 7}, {7, 5, 1}, {8, 7, 2}}, {{2, 5, 4}, {3, 2, 1}, {3, 7, 5}}, {{2, 5, 4}, {3, 2, 1}, {5, 6, 3}}, {{2, 5, 4}, {3, 2, 1}, {7, 5, 1}}, {{2, 5, 4}, {3, 2, 1}, {8, 7, 2}}, {{2, 5, 4}, {3, 7, 5}, {5, 6, 3}}, {{2, 5, 4}, {3, 7, 5}, {7, 5, 1}}, {{2, 5, 4}, {3, 7, 5}, {8, 7, 2}}, {{2, 5, 4}, {5, 6, 3}, {7, 5, 1}}, {{2, 5, 4}, {7, 5, 1}, {8, 7, 2}}, {{3, 2, 1}, {3, 7, 5}, {5, 6, 3}}, {{3, 2, 1}, {3, 7, 5}, {7, 5, 1}}, {{3, 2, 1}, {3, 7, 5}, {8, 7, 2}}, {{3, 2, 1}, {5, 6, 3}, {7, 5, 1}}, {{3, 2, 1}, {5, 6, 3}, {8, 7, 2}}, {{3, 2, 1}, {7, 5, 1}, {8, 7, 2}}, {{3, 7, 5}, {5, 6, 3}, {8, 7, 2}}, {{3, 7, 5}, {7, 5, 1}, {8, 7, 2}}, {{5, 6, 3}, {7, 5, 1}, {8, 7, 2}}}

Area /@ Triangle /@ result


list = {{{1, 8, 7}, {2, 5, 4}, {3, 2, 1}}, {{1, 8, 7}, {2, 5, 4}, {3,
7, 5}}, {{1, 8, 7}, {2, 5, 4}, {5, 6, 3}}, {{1, 8, 7}, {2, 5,
4}, {7, 5, 1}}, {{1, 8, 7}, {2, 5, 4}, {8, 7, 2}}, {{1, 8,
7}, {3, 2, 1}, {3, 7, 5}}, {{1, 8, 7}, {3, 2, 1}, {5, 6,
3}}, {{1, 8, 7}, {3, 2, 1}, {7, 5, 1}}, {{1, 8, 7}, {3, 2,
1}, {8, 7, 2}}, {{1, 8, 7}, {3, 7, 5}, {5, 6, 3}}, {{1, 8,
7}, {3, 7, 5}, {7, 5, 1}}, {{1, 8, 7}, {3, 7, 5}, {8, 7,
2}}, {{1, 8, 7}, {5, 6, 3}, {7, 5, 1}}, {{1, 8, 7}, {5, 6,
3}, {8, 7, 2}}, {{1, 8, 7}, {7, 5, 1}, {8, 7, 2}}, {{2, 5,
4}, {3, 2, 1}, {3, 7, 5}}, {{2, 5, 4}, {3, 2, 1}, {5, 6,
3}}, {{2, 5, 4}, {3, 2, 1}, {7, 5, 1}}, {{2, 5, 4}, {3, 2,
1}, {8, 7, 2}}, {{2, 5, 4}, {3, 7, 5}, {5, 6, 3}}, {{2, 5,
4}, {3, 7, 5}, {7, 5, 1}}, {{2, 5, 4}, {3, 7, 5}, {8, 7,
2}}, {{2, 5, 4}, {5, 6, 3}, {7, 5, 1}}, {{2, 5, 4}, {5, 6,
3}, {8, 7, 2}}, {{2, 5, 4}, {7, 5, 1}, {8, 7, 2}}, {{3, 2,
1}, {3, 7, 5}, {5, 6, 3}}, {{3, 2, 1}, {3, 7, 5}, {7, 5,
1}}, {{3, 2, 1}, {3, 7, 5}, {8, 7, 2}}, {{3, 2, 1}, {5, 6,
3}, {7, 5, 1}}, {{3, 2, 1}, {5, 6, 3}, {8, 7, 2}}, {{3, 2,
1}, {7, 5, 1}, {8, 7, 2}}, {{3, 7, 5}, {5, 6, 3}, {7, 5,
1}}, {{3, 7, 5}, {5, 6, 3}, {8, 7, 2}}, {{3, 7, 5}, {7, 5,
1}, {8, 7, 2}}, {{5, 6, 3}, {7, 5, 1}, {8, 7, 2}}};

r1 = Select[Area@Triangle@# > 0 &][list];
r2 = Select[Abs@Det@# > 0 &][list];
r3 = Select[MatrixRank@# == 3 &][list];
r4 = Select[VectorAngle @@ Subtract @@@ Partition[#, 2, 1] != 0 &][
list];
r1 == r2 == r3 == r4


True

Just one more way to do it is the following:

list = {{{1, 8, 7}, {2, 5, 4}, {3, 2, 1}}, {{1, 8, 7}, {2, 5, 4}, {3,
7, 5}}, {{1, 8, 7}, {2, 5, 4}, {5, 6, 3}}, {{1, 8, 7}, {2, 5,
4}, {7, 5, 1}}, {{1, 8, 7}, {2, 5, 4}, {8, 7, 2}}, {{1, 8,
7}, {3, 2, 1}, {3, 7, 5}}, {{1, 8, 7}, {3, 2, 1}, {5, 6,
3}}, {{1, 8, 7}, {3, 2, 1}, {7, 5, 1}}, {{1, 8, 7}, {3, 2,
1}, {8, 7, 2}}, {{1, 8, 7}, {3, 7, 5}, {5, 6, 3}}, {{1, 8,
7}, {3, 7, 5}, {7, 5, 1}}, {{1, 8, 7}, {3, 7, 5}, {8, 7,
2}}, {{1, 8, 7}, {5, 6, 3}, {7, 5, 1}}, {{1, 8, 7}, {5, 6,
3}, {8, 7, 2}}, {{1, 8, 7}, {7, 5, 1}, {8, 7, 2}}, {{2, 5,
4}, {3, 2, 1}, {3, 7, 5}}, {{2, 5, 4}, {3, 2, 1}, {5, 6,
3}}, {{2, 5, 4}, {3, 2, 1}, {7, 5, 1}}, {{2, 5, 4}, {3, 2,
1}, {8, 7, 2}}, {{2, 5, 4}, {3, 7, 5}, {5, 6, 3}}, {{2, 5,
4}, {3, 7, 5}, {7, 5, 1}}, {{2, 5, 4}, {3, 7, 5}, {8, 7,
2}}, {{2, 5, 4}, {5, 6, 3}, {7, 5, 1}}, {{2, 5, 4}, {5, 6,
3}, {8, 7, 2}}, {{2, 5, 4}, {7, 5, 1}, {8, 7, 2}}, {{3, 2,
1}, {3, 7, 5}, {5, 6, 3}}, {{3, 2, 1}, {3, 7, 5}, {7, 5,
1}}, {{3, 2, 1}, {3, 7, 5}, {8, 7, 2}}, {{3, 2, 1}, {5, 6,
3}, {7, 5, 1}}, {{3, 2, 1}, {5, 6, 3}, {8, 7, 2}}, {{3, 2,
1}, {7, 5, 1}, {8, 7, 2}}, {{3, 7, 5}, {5, 6, 3}, {7, 5,
1}}, {{3, 7, 5}, {5, 6, 3}, {8, 7, 2}}, {{3, 7, 5}, {7, 5,
1}, {8, 7, 2}}, {{5, 6, 3}, {7, 5, 1}, {8, 7, 2}}};

Cases[#, m_ /; NullSpace[m] == {}] &@list

{{{1, 8, 7}, {2, 5, 4}, {3, 7, 5}}, {{1, 8, 7}, {2, 5, 4}, {5, 6,
3}}, {{1, 8, 7}, {2, 5, 4}, {7, 5, 1}}, {{1, 8, 7}, {2, 5, 4}, {8,
7, 2}}, {{1, 8, 7}, {3, 2, 1}, {3, 7, 5}}, {{1, 8, 7}, {3, 2,
1}, {5, 6, 3}}, {{1, 8, 7}, {3, 2, 1}, {7, 5, 1}}, {{1, 8, 7}, {3,
2, 1}, {8, 7, 2}}, {{1, 8, 7}, {3, 7, 5}, {8, 7, 2}}, {{1, 8,
7}, {5, 6, 3}, {8, 7, 2}}, {{1, 8, 7}, {7, 5, 1}, {8, 7, 2}}, {{2,
5, 4}, {3, 2, 1}, {3, 7, 5}}, {{2, 5, 4}, {3, 2, 1}, {5, 6,
3}}, {{2, 5, 4}, {3, 2, 1}, {7, 5, 1}}, {{2, 5, 4}, {3, 2, 1}, {8,
7, 2}}, {{2, 5, 4}, {3, 7, 5}, {5, 6, 3}}, {{2, 5, 4}, {3, 7,
5}, {7, 5, 1}}, {{2, 5, 4}, {3, 7, 5}, {8, 7, 2}}, {{2, 5, 4}, {5,
6, 3}, {7, 5, 1}}, {{2, 5, 4}, {7, 5, 1}, {8, 7, 2}}, {{3, 2,
1}, {3, 7, 5}, {5, 6, 3}}, {{3, 2, 1}, {3, 7, 5}, {7, 5, 1}}, {{3,
2, 1}, {3, 7, 5}, {8, 7, 2}}, {{3, 2, 1}, {5, 6, 3}, {7, 5,
1}}, {{3, 2, 1}, {5, 6, 3}, {8, 7, 2}}, {{3, 2, 1}, {7, 5, 1}, {8,
7, 2}}, {{3, 7, 5}, {5, 6, 3}, {8, 7, 2}}, {{3, 7, 5}, {7, 5,
1}, {8, 7, 2}}, {{5, 6, 3}, {7, 5, 1}, {8, 7, 2}}}


Another way is the following:

list[[Flatten[
Position[DiagonalMatrixQ@RowReduce[#] & /@ list, True]]]]


Output is:

{{{1, 8, 7}, {2, 5, 4}, {3, 7, 5}}, {{1, 8, 7}, {2, 5, 4}, {5, 6, 3}}, {{1, 8, 7}, {2, 5, 4}, {7, 5, 1}}, {{1, 8, 7}, {2, 5, 4}, {8, 7, 2}}, {{1, 8, 7}, {3, 2, 1}, {3, 7, 5}}, {{1, 8, 7}, {3, 2, 1}, {5, 6, 3}}, {{1, 8, 7}, {3, 2, 1}, {7, 5, 1}}, {{1, 8, 7}, {3, 2, 1}, {8, 7, 2}}, {{1, 8, 7}, {3, 7, 5}, {8, 7, 2}}, {{1, 8, 7}, {5, 6, 3}, {8, 7, 2}}, {{1, 8, 7}, {7, 5, 1}, {8, 7, 2}}, {{2, 5, 4}, {3, 2, 1}, {3, 7, 5}}, {{2, 5, 4}, {3, 2, 1}, {5, 6, 3}}, {{2, 5, 4}, {3, 2, 1}, {7, 5, 1}}, {{2, 5, 4}, {3, 2, 1}, {8, 7, 2}}, {{2, 5, 4}, {3, 7, 5}, {5, 6, 3}}, {{2, 5, 4}, {3, 7, 5}, {7, 5, 1}}, {{2, 5, 4}, {3, 7, 5}, {8, 7, 2}}, {{2, 5, 4}, {5, 6, 3}, {7, 5, 1}}, {{2, 5, 4}, {7, 5, 1}, {8, 7, 2}}, {{3, 2, 1}, {3, 7, 5}, {5, 6, 3}}, {{3, 2, 1}, {3, 7, 5}, {7, 5, 1}}, {{3, 2, 1}, {3, 7, 5}, {8, 7, 2}}, {{3, 2, 1}, {5, 6, 3}, {7, 5, 1}}, {{3, 2, 1}, {5, 6, 3}, {8, 7, 2}}, {{3, 2, 1}, {7, 5, 1}, {8, 7, 2}}, {{3, 7, 5}, {5, 6, 3}, {8, 7, 2}}, {{3, 7, 5}, {7, 5, 1}, {8, 7, 2}}, {{5, 6, 3}, {7, 5, 1}, {8, 7, 2}}}

The original list

list = {{{1, 8, 7}, {2, 5, 4}, {3, 2, 1}}, {{1, 8, 7}, {2, 5, 4}, {3,
7, 5}}, {{1, 8, 7}, {2, 5, 4}, {5, 6, 3}}, {{1, 8, 7}, {2, 5,
4}, {7, 5, 1}}, {{1, 8, 7}, {2, 5, 4}, {8, 7, 2}}, {{1, 8,
7}, {3, 2, 1}, {3, 7, 5}}, {{1, 8, 7}, {3, 2, 1}, {5, 6,
3}}, {{1, 8, 7}, {3, 2, 1}, {7, 5, 1}}, {{1, 8, 7}, {3, 2,
1}, {8, 7, 2}}, {{1, 8, 7}, {3, 7, 5}, {5, 6, 3}}, {{1, 8,
7}, {3, 7, 5}, {7, 5, 1}}, {{1, 8, 7}, {3, 7, 5}, {8, 7,
2}}, {{1, 8, 7}, {5, 6, 3}, {7, 5, 1}}, {{1, 8, 7}, {5, 6,
3}, {8, 7, 2}}, {{1, 8, 7}, {7, 5, 1}, {8, 7, 2}}, {{2, 5,
4}, {3, 2, 1}, {3, 7, 5}}, {{2, 5, 4}, {3, 2, 1}, {5, 6,
3}}, {{2, 5, 4}, {3, 2, 1}, {7, 5, 1}}, {{2, 5, 4}, {3, 2,
1}, {8, 7, 2}}, {{2, 5, 4}, {3, 7, 5}, {5, 6, 3}}, {{2, 5,
4}, {3, 7, 5}, {7, 5, 1}}, {{2, 5, 4}, {3, 7, 5}, {8, 7,
2}}, {{2, 5, 4}, {5, 6, 3}, {7, 5, 1}}, {{2, 5, 4}, {5, 6,
3}, {8, 7, 2}}, {{2, 5, 4}, {7, 5, 1}, {8, 7, 2}}, {{3, 2,
1}, {3, 7, 5}, {5, 6, 3}}, {{3, 2, 1}, {3, 7, 5}, {7, 5,
1}}, {{3, 2, 1}, {3, 7, 5}, {8, 7, 2}}, {{3, 2, 1}, {5, 6,
3}, {7, 5, 1}}, {{3, 2, 1}, {5, 6, 3}, {8, 7, 2}}, {{3, 2,
1}, {7, 5, 1}, {8, 7, 2}}, {{3, 7, 5}, {5, 6, 3}, {7, 5,
1}}, {{3, 7, 5}, {5, 6, 3}, {8, 7, 2}}, {{3, 7, 5}, {7, 5,
1}, {8, 7, 2}}, {{5, 6, 3}, {7, 5, 1}, {8, 7, 2}}};