# How to check if a point is behind a plane (along a vector)?

I have an arbitrary vertex $$v$$ from a plane with a normal vector $$\vec{n}$$, I have a ray vector $$\vec{r}$$ I am shooting through the plane sort of, from a point $$p$$, I want to know if the point is behind the plane relative to the ray vector instead (I tried applying the same logic here asper the point being behind the plane relative to the normal vector, but that didn’t work)

Example
plane $$(0,0,0)$$ $$(4,0,0)$$ $$(0,0,4)$$ $$(4,0,4)$$
normal $$\vec{n}$$ $$[0,1,0]$$
ray $$\vec{r}$$ $$[1,1,0]$$
point $$p$$ $$(1,2,2)$$

I meant I tried picking an arbitrary vertex $$v=(4,0,4)$$ and doing $$\vec{r} \cdot (p-v)$$ and it turned out incorrect. Although for $$v=(0,0,4)$$ it works as expected.

Please how can one decipher if a point is behind a plane relative to some vector?

here’s my plane with the normal and ray vectors

here’s how one would normally check if a point is behind a plane (i.e. $$\vec{n} \cdot (p-v)$$):

here’s what I want to do instead:

• I apologize for not being able to convey the idea understandably, I would be supporting this question with a diagram later today when I am chanced. The problem is given a plane and a point, determining which side of the plane the point is while moving along the ray so to say. Normally checking if a point is on either sides of a plane would be checking that the point is behind or infront of it along the normal to the plane Commented Mar 22, 2022 at 11:44
• I believe I've understood it now (see my answer). If you meant something different, just say so. Commented Mar 22, 2022 at 11:51

Define $$s:=\left(\vec n\cdot\vec r\right)\left((p-v)\cdot\vec n\right).$$

Case 1: $$s=0$$ Then, the ray vector $$\vec r$$ is parallel to the plane or your point $$p$$ is in your plane.

Case 2: $$s>0$$ Then, your point $$p$$ is in the same half space which the ray vector $$\vec r$$ points into.

Case 3: $$s<0$$ Your point $$p$$ is behind the plane w.r.t. the ray vector $$\vec r$$.

This method works since $$\vec n\cdot \vec r$$ checks if $$\vec n$$ and $$\vec r$$ "are on the same side" of your plane, while $$\left((p-v)\cdot\vec n\right)$$ checks if $$p$$ is on the same side as the normal vector.