I have been working on fitting a plane to 3d points and then calculating the perpendicular distance between each point and the plane using Matlab. So far I can find the plane equation in $Ax+By+Cz+D = 0$ form and calculate the distance using $\frac{Ax_0+By_0+Cz_0+D}{\sqrt{A^2+B^2+C^2}}$. However, in some Matlab codes plane is defined as $Ax+By+C = z$ which seems quite different from the above plane equation. Even though I did some research about difference of these equations, I could not find any satisfactory answer. Could you please explain me the difference between these two plane definitions and could you please inform me about the distance between any point and plane $Ax+By+C = z$ ? I am looking forward to hearing from you. Thanks in advance
Perpendicular distance between point and plane
567 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 2 best solutions below
On
The two plane equations are nearly equivalent since you can change one into the other with some algebraic manipulation. Starting with the new equation with lowercase coefficients for clarity: $$ax + by + c = z$$ Subtract $z$ from both sides: $$ax + by - z + c = 0$$ This has the same form as the equation you've been using. By matching up coefficients $$Ax + By + Cz + D = 0$$ we can see that $A=a$, $B=b$, $C=-1$, and $D=c$. So, the distance formula becomes $$distance = \frac{Ax_0 + By_0 + Cz_0 + D}{\sqrt{A^2 + B^2 + C^2}}=\frac{ax_0 + by_0 - z_0 + c}{\sqrt{a^2 + b^2 + 1}}$$
Going the other way, starting from $$Ax + By + Cz + D = 0$$ Subtract $Cz$ from both sides $$Ax + By + D = -Cz$$ Divide by $-C$ $$-\frac A C x - \frac B C y - \frac D C = z$$ Matching up coefficients with $$ax + by + c = z$$ results in $a=-\frac A C$, $b = -\frac B C$, and $c = -\frac D C$. Notice that since we divided by $C$ to get this other formula, this form of the plane equation cannot represent planes where $C=0$, which are parallel to the $z$-axis. So, the second form of the equation describes only a subset of planes compared to the first.
I think it may be a glitch or something.
As far i know the equation of a plane in 3d is Ax+By+Cz=D where (A,B,C)are any points on the plane. Here I think that the Z should be in the left size with a minus sign similarly c in the right side.
Thus it should makes a equation Ax+By-Z=-C where the points which are gonna lie on the plane should (A,B,-1).