Computing the distance from a point and the plane?

300 Views Asked by At

I'm trying to compute the distance between a point and a plane of the form $$ ax+bx+cz = d $$ not using the standard formula for analytical geometry.

  • I am trying to compute it by coming up with the projection matrix onto the normal of the plane passing through the origin and then projecting a a vector that is shifted the amount required to make the plane pass through the origin and then taking the length of that vector.
  • I upload pictures of my work for the first one I used this method and it worked it gave me the correct distance, but for any other equation it doesn't seem to work and I cant figure out why or what to change to make it work.

Example of the method working, Example of method not working

2

There are 2 best solutions below

1
On

A line perpendicular to the plane, through the point $(u,v,w)$ has the parametric equation

$$x=u+ta,\\y=v+tb,\\z=w+tc.$$

It intersects the plane when

$$a(u+ta)+b(v+tb)+c(w+tc)=d$$ or

$$t=\frac{d-au-bv-cw}{a^2+b^2+c^2}$$

and the distance between the two points is given by

$$\sqrt{(ta)^2+(tb)^2+(tc)^2}=|t|\sqrt{a^2+b^2+c^2}=\frac{|d-au-bv-cw|}{\sqrt{a^2+b^2+c^2}}.$$

0
On

you can calculate the distance between those points is by that formula:

1)find two linearly independent vectors from the plane ($\vec u$, $\vec v$)

2)find a vector from any point on the plane to the desired point on the line ($\vec w$).

3)calculate the determinant of |$\vec v$ $\vec u$ $\vec w$|, now you have the volume of the parallelepiped that those 3 vectors make.

4)divide the volume of the parallelepiped by |$\vec v $ x $ \vec u$| which is the surface of one face of the parallelepiped.

this formula always gives the shortest distance from a point to a surface.