# A 'simple' vector problem - where a line meets a plane

1. Feb 24, 2012

### Snoopey

Hi all,
I am a little stuck on a problem I'm trying to solve for something I'm programming.
I'm trying to find the point at which a line meets a plane.

The line is defined as $\vec{x} = \vec{a}+d\vec{l}$
where $\vec{a}$ is a point on the line, $\vec{l}$ is a unit vector defining the direction of the line and d is the distance along the line.

The plane is defined using a point $\vec{x_{0}}$ and normal $\vec{n}$ as $\vec{n}.\left(\vec{x}-\vec{x_{0}}\right)=0$

I want to sub in my line equation into my plane equation and solve for $d$ to get $\vec{x}$ but my vector algebra is very rusty and I cant for the life of me figure out how to get my $d$ out.

The funny thing is I used a similar method to find where a line intersects a sphere with equation $\left|\vec{x}-\vec{c}\right|^{2}=R^{2}$ ($\vec{c}$ = centre, $R$ = radius) and subbed in no problems. But that dot product in the plane equation is just confusing me.

Has anyone got any suggestions for me to follow?
Many thanks!

2. Feb 24, 2012

### HallsofIvy

Two vectors are perpendicular if and only if their dot product is 0. If x and x0 are both points in the plane, then the vector x- x0 lies in the plane so the dot product is just saying that the normal, n and the vector x- x0 are perpendicular- which is the definition of "normal vector"!) Suppose the normal vector, n, is given by <A, B, C>, the generic point x by (x, y, z), and the point x[sub0[/sub by <x0, y0, z0>. Then x- x0 is <x- x0, y- y0, z- z0> so the dot product is A(x- x0)+ B(y- y0), C(z- z0)= 0.

Now suppose $\vec{a}= <a_1, a_2, a_3>$ and $\vec{l}= <l_1, l_2, l_3>$ so that the line $\vec{x}= <a_1, a_2, a_3>+ d<l_1, l_2, l_3>= <a_1+ dl_1, a_2+ dl_2, a_3+ dl_3>$. Okay, put those components in for x, y, and z in the equation of the plane: $A(a_1+ dl_1x_0)+ B(a_2+ dl_2y_0)+ C(a_3+ dl_3z_0)= 0$

Multiplying that out, $Aa_1+ Adl_1x_0+ Ba_2+ Bdl_2y_0+ Ca_3+ Cdl_3z_0= 0$

Moving everything that does not involve "d" to the right, and factoring d out,
$(Al_1x_0+ Bl_2y_0+ Cl_3z_0)d= -(Aa_1+ Ba_2+ Ca_3)$

Now, of course, divide both sides by $(Al_1x_0+ Bl_2y_0+ Cl_3z_0)$ to solve for d.

Finally, put that value of d int0 the formula for the line to determine the point of intersection.

3. Feb 25, 2012

### Snoopey

Brilliant! Thank you for this, not sure why I didn't think of splitting into the different compenents :)

edit: For anyone interested I simplified the end result into

$d= \frac{\vec{n}.(\vec{x_{0}}-\vec{a})}{\vec{n}.\vec{l}}$