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,

enter image description here

  • $\begingroup$ I don't understand why you use the cross product in the first place. But anyway, how do you define the cross product in 4 dimensions? $\endgroup$
    – Matt L.
    Mar 20, 2021 at 12:35
  • $\begingroup$ Using a cross product for find lines has been central to projective geometry, which is the main mathematical tool behind all cameras and video recorders. Generally to find point of intersection of two lines, or line lying on two points require solving some equations, and homogenous coordinate system simplifies it. Kindly search for HOMOGENOUS COORDINATE SYSTEM on Wikipedia or refer classic books like Multiple View Geometry by Andrew Zisserman for importance of cross product in homogenous coordinate system. $\endgroup$ Mar 20, 2021 at 13:27
  • $\begingroup$ @MattL. I used stackoverflow.com/a/9489115/13049379 for computing the cross product for any dimension. It gives correct results for 3D vectors and have not checked for 4D vectors. $\endgroup$ Mar 20, 2021 at 13:43
  • $\begingroup$ OK, but please read up on the cross product. As a product of two vectors with the result being a vector, it only exists in 3 or 7 dimensions. $\endgroup$
    – Matt L.
    Mar 20, 2021 at 13:48


Your Answer

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