4
$\begingroup$

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.

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

4 Answers 4

9
$\begingroup$
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

enter image description here

$\endgroup$
5
$\begingroup$
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

$\endgroup$
4
$\begingroup$

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}}}
$\endgroup$
4
$\begingroup$

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}}};
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.