Question: How to select element with z=0

Have a list of four projective points. I need to check that they are colinear projectively. If one point is at infinity i.e. 0 in z position I can chech if combination of cross product and dot product is 0.
a)  What is a good way to find if one ot the four has zero in z position?

b) Having found that is there a neat way of piching the next two/three points by making the count wrap automatically. e.g 3  then 4,5,6 i.e. 3,4,1,2

restart

with(LinearAlgebra)

pt := [`<,>`(1, 1, 1), `<,>`(2, 1, 1), `<,>`(3, 1, 0), `<,>`(4, 1, 1)]

pt := [Vector(3, {(1) = 1, (2) = 1, (3) = 1}), Vector(3, {(1) = 2, (2) = 1, (3) = 1}), Vector(3, {(1) = 3, (2) = 1, (3) = 0}), Vector(3, {(1) = 4, (2) = 1, (3) = 1})]

(1)

ListTools(Occurences([anything, anything, 0], pt))

ListTools(Occurences([anything, anything, 0], [Vector(3, {(1) = 1, (2) = 1, (3) = 1}), Vector(3, {(1) = 2, (2) = 1, (3) = 1}), Vector(3, {(1) = 3, (2) = 1, (3) = 0}), Vector(3, {(1) = 4, (2) = 1, (3) = 1})]))

(2)

``

`&x`(pt[1]-pt[3], pt[1]-pt[3]).(pt[4]-pt[3])

0

(3)

NULL

Download 2024-06-18_Q_4_points_projective_colinear.mw

Please Wait...