Line-plane intersection
From Wikipedia, the free encyclopedia
In analytic geometry, the intersection of a line and a plane can be the empty set, a point, or a line. Distinguishing these cases, and determining equations for the point and line in the latter cases have use, for example, in computer graphics, motion planning, and collision detection.
[edit] Equations in 3D Euclidean space
[edit] Parametric form
A line is described by all points that are a given direction from a point. Thus a line can be represented as
- <math>\mathbf{p}_a + (\mathbf{p}_b - \mathbf{p}_a)t, \quad t\in \mathbb{R}, </math>
where <math>\mathbf{p}_a=(x_a,y_a,z_a)</math> and <math>\mathbf{p}_b=(x_b,y_b,z_b)</math> are two distinct points along the line.
Similarly a plane can be represented as
- <math>\mathbf{p}_0 + (\mathbf{p}_1-\mathbf{p}_0)u + (\mathbf{p}_2-\mathbf{p}_0)v, \quad u,v\in\mathbb{R}</math>
where <math>\mathbf{p}_k=(x_k,y_k,z_k)</math>, <math>k=0,1,2</math> are three points in the plane.
The point at which the line intersects the plane is therefore described by setting the line equal to the plane in the parametric equation:
- <math>\mathbf{p}_a + (\mathbf{p}_b - \mathbf{p}_a)t = \mathbf{p}_0 + (\mathbf{p}_1-\mathbf{p}_0)u + (\mathbf{p}_2-\mathbf{p}_0)v</math>
This can be simplified to
- <math>\mathbf{p}_a - \mathbf{p}_0 = (\mathbf{p}_a - \mathbf{p}_b)t + (\mathbf{p}_1-\mathbf{p}_0)u + (\mathbf{p}_2-\mathbf{p}_0)v,</math>
which can be expressed in matrix form as:
- <math> \begin{bmatrix} x_a - x_0 \\ y_a - y_0 \\ z_a - z_0 \end{bmatrix} = \begin{bmatrix} x_a - x_b & x_1 - x_0 & x_2 - x_0 \\ y_a - y_b & y_1 - y_0 & y_2 - y_0 \\ z_a - z_b & z_1 - z_0 & z_2 - z_0 \end{bmatrix} \begin{bmatrix} t \\ u \\ v \end{bmatrix} </math>
The point of intersection is then equal to
- <math>\mathbf{p}_a + (\mathbf{p}_b - \mathbf{p}_a)t</math>
[edit] Usage
If the solution satisfies the condition <math>t \in [0,1],</math>, then the intersection point is on the line between <math>\mathbf{p}_a</math> and <math>\mathbf{p}_b</math>.
If the solution satisfies
- <math>u,v \in [0,1], \;\;\; (u+v) \leq 1,</math>
then the intersection point is in the plane inside the triangle spanned by the three points <math>\mathbf{p}_0</math>, <math>\mathbf{p}_1</math> and <math>\mathbf{p}_2</math>.
This problem is typically solved by expressing it in matrix form, and inverting it:
- <math> \begin{bmatrix} t \\ u \\ v \end{bmatrix} = \begin{bmatrix} x_a - x_b & x_1 - x_0 & x_2 - x_0 \\ y_a - y_b & y_1 - y_0 & y_2 - y_0 \\ z_a - z_b & z_1 - z_0 & z_2 - z_0 \end{bmatrix}^{-1} \begin{bmatrix} x_a - x_0 \\ y_a - y_0 \\ z_a - z_0 \end{bmatrix} </math>eo:Vikipedio:Projekto matematiko/Linio-ebena komunaĵo

