My derived formula for point distance from a plane is not the same as a supplied one...but it works...why? Putting myself through intro linear algebra, and I have this situation where my derived equation is not matching that in my book.
I'm tasked with finding the perpendicular/normal distance of an arbitrary point $Q$ to a plane, and my logic is the following:
Formula relating point $X$ in the plane to the normal vector for the plane:
$$(X-cN)\cdot N = 0$$
...in here, "$cN$" is the point in the plane along normal vector $N$.
Formula relating point $Q$ (above the plane) to an imaginary plane that intersects $Q$ and where $N$ is a normal vector (in this case, "$dN$" is the point along vector $N$ in this new plane):
$$(Q-dN)\cdot N = 0$$
These equations become the following:
$$X\cdot N = cN\cdot N$$
$$Q\cdot N = dN\cdot N$$
...and therefore,
$$c = \frac{X\cdot N}{N\cdot N}$$
$$d = \frac{Q\cdot N}{N\cdot N}$$
Since the distance between the planes is directly related to these two scalars, we can subtract $c$ from $d$ to get our distance:
$$d - c = \frac{Q\cdot N}{N\cdot N} - \frac{X\cdot N}{N\cdot N} = \frac{(Q-X)\cdot N}{N\cdot N}$$
...so this makes sense to me, both by this logic, and by the observation that this is the formula for the projection of vector $\overrightarrow{XQ}$ along $N$. It also seems to work just fine when I plug it into various problems (or when dreaming up any set of points and planes to test).
However, the following is the formula given to me in the book I am using (Serge Lang's Intro to Linear Algebra):
$$\frac{|(Q-X)\cdot N|}{||N||}$$
...in here, the denominator is the length, and not just the dot product of the normal vector, and I am not seeing the logic in this at all, especially since the above works. Is there something I'm missing here?
 A: $N \cdot N = \|N\|^2$. Your formula also allows the answer to be negative,
whereas the other formula forces the answer to be non-negative by
taking the absolute value of the numerator.
So really one formula is simply a factor of $\pm\|N\|$
times the other. Your measure $d - c$ is the (directed) 
distance between the planes measured in "$N$-lengths"; 
that is, the distance between the planes is $(d-c)\|N\|$, measured
from the $X$ plane to the $Q$ plane and taking the direction of $N$
as the "positive" direction.
If $\|N\| \neq 1$ then to get the distance relative to the unit measure
you should multiply your formula by $\|N\|$.
If you also want to measure the distance as a non-negative number,
you should also take the absolute value.
Having done this, you would arrive at the other formula.
For an example of where your formula can give a negative answer,
consider $N=(0,0,2)^T$, $X=(0,0,6)^T$, and $Q=(1,0,0)^T$.
Then $c=3$, $d=0$, and $d-c=-3$.
This also shows the effect of the scaling factor, $\|N\|$;
the two planes are the planes $z=6$ and $z=0$ in Cartesian coordinates,
and usually we would say the distance between them is $6$ rather than $3$.

In favor of not taking the absolute value of the distance, a value
that can be negative of positive can tell you which plane is "above" the other
relative to a given direction "up".
If $\|N\| \neq 1$ and you do not correct for the "scale factor", you still
have a useful mechanism for saying whether one pair of planes is farther
apart than another pair of planes. The actual values you get just won't
be measured in the same units in which $\|N\|$ is measured.
A: I didn't understand your derivation but your formula can be seen to be wrong just by observing that it does not satisfy scale invariance. Specifically, if you double the normal vector, your formula's value will halve.
