For calculations in 2D space, there exist a few useful equations to compute general geometry with the vector dot product . and the vector cross product x when working with homogeneous coordinates (remember even though we are working in 2D space the homogeneous representation of lines and point are 3D vectors):
1) The point where two lines cross x = l1 x l2.
2) The line between two points l = x1 x x2
3) A point lies on a line if x . l = 0
In 3D space a plane can be described by a normal vector n = [n1, n2, n3] and a point on the plane x = [x1, x2, x3] both in Euclidean coordinates.
In homogeneous coordinated the plane can be defined as p = [n1, n2, n3, -(n1*x1 + n2*x2 + n3*x3)].
Is there a short equation for finding the point where a line passes through a plane? Intuitively it feels as it should be x = l x p in homogeneous coordinates, but this computation does not exist, since there is no cross product in 4 dimensions.
At the moment I am only able to compute the intersection by defining the line with the equation l(t) = a + b(t), where a is a point on the line and b is the direction of the line in Euclidean coordinates.
For a = [a1, a2, a3], b = [b1, b2, b3] and the plane in question p = [p1, p2, p3, p4], the point of intersection x = [x1, x2, x3] can be obtained by substituting t in the line equation with t = -(p . [a1, a2, a3, 1])/(p . [b1, b2, b3, 0])
In summary, is there a elegant equation to find a point x where a line l crosses through a plane p preferably in homogeneous coordinates?
Best Answer
Definition
You are right, 3D points and planes are described with 4 homogeneous coordinates. A point at $\vec{r}$ is $P=(\vec{r};1)$ and a plane $W=(\vec{n};-d)=(\vec{n};-\vec{r}\cdot\vec{n})$ with normal $\vec{n}$ through point $\vec{r}$, or with minimum distance to origin $d$.
A line needs 6 coordinates (plücker coordinates) describing the direction and moment about the axis. A line along $\vec{e}$ through a point $\vec{r}$ has coordinates $L=[\vec{e};\vec{r}\times\vec{e}]$. Given a line $L=[\vec{l};\vec{m}]$, the direction is recovered by $\vec{e}=\frac{\vec{l}}{|\vec{l}|}$ and the position by $\vec{r} = \frac{\vec{l}\times\vec{m}}{|\vec{l}|^2}$
Now derive the point $P=(\vec{r};1)$ where line $L=[\vec{l};\vec{m}]$ meets plane $W=(\vec{w};\epsilon)$ as follows:
$$ \vec{w} \times \vec{m} = \vec{r} (\vec{w}\cdot\vec{l}) - \vec{l}(-\epsilon) $$
$$ \vec{r} = \frac{\vec{w}\times\vec{m}-\epsilon \vec{l}}{\vec{w}\cdot\vec{l}} $$
$$ \begin{aligned} P & = [W\times] L \\ \begin{pmatrix} \vec{p} \\ \delta \end{pmatrix} & = \begin{bmatrix} -\epsilon {\bf 1} & \vec{w}\times \\ \vec{w}^\top & 0 \end{bmatrix} \begin{pmatrix} \vec{l} \\ \vec{m} \end{pmatrix} \end{aligned}$$
where $\vec{w}\times = \begin{pmatrix}x\\y\\z\end{pmatrix} \times = \begin{bmatrix} 0 & -z & y \\ z & 0 & -x \\ -y & x & 0 \end{bmatrix}$ is the cross product matrix operator in 3×3 form.
Example