Given two points P
and Q
we can convert them to the homogeneous coordinate system, compute their cross product and thus get the equation of line passing through them. I am able to verify it for 2D but not for 3D. An illustrating example is given below and require help in interpreting the results for 3D case.
case: 2D
Let P=[1,1]
and Q=[2,2]
. Then computing their cross product in the homogenous coordinate system gives [1,1,1] crossProduct [2,2,1] = [-1,1,0]
which implies line -x + y + 0z = 0
which is nothing but the line y=x
and is the correct answer.
case: 3D Does not verify with correct answer
Let P=[3,-1,2]
and Q=[-3,0,1]
. Then computing their cross product in the homogenous coordinate system gives [3,-1,2,1] crossProduct [-3,0,1,1] = [-1, 16, 2, 5]
. But this does not seem to match with the answer obtained using conventional approach shown below,