# How to calculate the intersection point of a vector and a plane defined as a point and normal vector?

I've read through some of the questions on line-plane intersection but I'm struggling because many define the plane in a format like:

$$4x-2y+5z-9=0$$,

but my plane is defined as a point ($$x_p, y_p, z_p$$) and the unit vector normal to the plane ($$i_p, j_p, k_p$$).

My line is defined by a point ($$x_v, y_v, z_v$$) and a unit vector in the direction of the line ($$i_v, j_v, k_v$$),

I can't figure out how to apply what I've read in other questions to my scenario, which I will need to implement in some generic VB.NET code.

• Welcome to Mathematics Stack Exchange. It might be easier to explain with a numerical example, but basically the equation of your plane is $i_px+j_py+k_px-(i_px_p+j_py_p+k_pz_p)=0$; on the other hand, the normal vector to the plane $4x-2y+5z-9=0$ is $(4,-2,5)$ – J. W. Tanner Oct 28 '19 at 10:20
• You’re only one simple step away from an equation of that form for the plane. Look up “point-normal form.” – amd Oct 28 '19 at 17:03
• @amd only simple if you know. Fortunately AugSB’s answer got me there. – Notts90 supports Monica Oct 28 '19 at 17:04
• You could’ve gotten there yourself. I’d bet that he started with that form, substituted a generic point on the line into it and then solved for the unknown multiple of the line’s unit direction vector. – amd Oct 28 '19 at 17:06

Let $$P_v=(x_p,y_p,z_p)$$, $$P_p=(x_v,y_v,z_v)$$, $$\vec{v_v}=(i_v,j_v,k_v)$$ and $$\vec{v_p}=(i_p,j_p,k_p)$$. Then

$$P_{intersection} = P_v + \frac{(P_p-P_v)\cdot\vec{v_p}}{\vec{v_v}\cdot\vec{v_p}} \ \vec{v_v}$$

I assume you already know the basics of operations with vectors and points...

EDIT: This formula can be easily derived from the vectorial definition of planes and lines. A point $$P$$ belongs to the plane defined by $$P_p$$ and $$\vec{v_p}$$ if $$(P-P_p)\cdot\vec{v_p}=0$$. Moreover, points of the line defined by $$P_v$$ and $$\vec{v_v}$$ are of the form $$P_v+\lambda \vec{v_v}$$. Note that the intersection point has to satisfy both conditions, so it is enouh to plug in the line form into the plane equation and solve: $$(P_v+\lambda \vec{v_v}-P_p)\cdot\vec{v_p}=0 \iff \lambda =\frac{(P_p-P_v)\cdot\vec{v_p}}{\vec{v_v}\cdot\vec{v_p}}$$ Of course, if $$\vec{v_v}\cdot\vec{v_p}=0$$, both elements would be parallel, so there would not be any intersection point.

• Its been a while but yes! Use dot product on the vectors right? I best get refreshing... – Notts90 supports Monica Oct 28 '19 at 10:31
• This answer would be much improved if you explained how you arrived at this mysterious formula. – amd Oct 28 '19 at 17:07
• @amd mysterious answer that works great. – Notts90 supports Monica Oct 28 '19 at 17:15
• @amd It is not so misterious, you can find it in plenty of webpages (starting from Wikipedia itself). Anyhow, I added a brief explanation to complete the answer. – AugSB Oct 29 '19 at 7:47
• It is mysterious when you present it as a fact accompli with no explanation or references. – amd Oct 29 '19 at 16:24

If $$\vec P=(x,y,z)$$ is some point of the plane that is given by point $$\vec A$$ and a normal $$\vec n$$, then by definition of normal the vector $$\vec{AP}=\vec P -\vec A$$ is perpendicular to $$\vec n$$, so the scalar product $$\vec{AP}\cdot\vec n=0$$.

By writing this in coordinate form, you will get the plane equation: $$(x-x_v)i_v+(y-y_v)j_v+(z-z_v)k_v = 0,\\ i_vx+j_vy+k_vz-(i_vx_v+j_vy_v+k_vz_v)=0$$