# Proof for distance formula

1. Oct 6, 2006

### Reshma

The distance 'D' of a point (x0,y0,z0) from a plane ax + by +cz + d = 0 is given by the formula:

$$D = \left|\frac{ax_0 + by_0 + cz_0 + d}{a^2 + b^2 + c^2}\right|$$

Could someone give me some explanation\links on the proof\derivation of this formula? Thanks in advance.

Last edited: Oct 6, 2006
2. Oct 6, 2006

### arildno

First, do NOT use "d" in two distinct meanings! :grumpy:

I'll call the distance D hereafter.

Now, what should we mean by D?

What is a meaningful definition of the distance from a plane to a point?

3. Oct 6, 2006

### HallsofIvy

Arildno, as often as I have complained about people using capital letters ("D") and small letters ("d") to mean the same thing, I have no problem with using "D" and "d" to mean different things!

Reshma, there are two ways to do that:

1. For any point (x,y,z) in the plane, the square of the distance from that point to (x0, y0, z0) is
(x- x0)2+ (y- y0)2+ (z- z0)2). You can minimize that subject to the condition that ax+ by+ cz+ d= 0 by using Lagrange multipliers or by replacing z in the distance formula by z= (-ax-by-d)/c and then setting partial derivatives to 0.

2. (Simpler) Argue that, geometrically, the line from (x0,y0,z0) to the nearest point on the plane is perpendicular to the plane (any other line would be the hypotenuse of a right triangle and so longer than a leg). Find the equation of the line through (x0, y0, z0) in the direction of a normal vector to the plane (which is ai+ bj+ ck). Determine where that intersects the plane.

4. Oct 6, 2006

### arildno

If you look at Reshma's edit, that was made while I wrote my post!
I agree, Reshma did correct his usage of small "d" to mean two different things (for distance AND for the constant term).

5. Oct 7, 2006

### Reshma

Thanks HallsofIvy and arildno. I will follow the technique that you have suggested and post my proof soon.

It is "her". Never mind, not your fault. :tongue2:

6. Oct 8, 2006

### Reshma

The vector normal to the plane ax + by + cz + d = 0 is:
$$\vec n = a\hat i + b\hat j + c\hat k$$
The line from any point (x, y, z) on the plane to a point P(x0,y0,z0) lying outside the plane is:
$$\vec m = (x - x_0)\hat i + (y - y_0)\hat j + (z - z_0)\hat k$$

So distance 'D' of P(x0,y0,z0) from the plane is equal to the projection of $\vec m$ on $\vec n$.

$$D = \frac{\left |\vec m \cdot \vec n\right|}{|\vec n|}$$
$$D = \frac{a(x - x_0) + b(y - y_0) + c(z - z_0)}{\sqrt{a^2 + b^2 + c^2}}$$

$$D = \left|\frac{ax_0 + by_0 + cz_0 + d}{\sqrt{a^2 + b^2 + c^2}\right|}$$

considering the absolute values...

Last edited: Oct 8, 2006