Distance from plane to point

Uffe Friis Lichtenberg (uffefl@diku.dk)
Tue, 26 Mar 1996 11:26:04 +0100 (MET)

Date: Tue, 26 Mar 1996 11:26:04 +0100 (MET)
From: Uffe Friis Lichtenberg <uffefl@diku.dk>
To: quake-editing@nvg.unit.no
Subject: Distance from plane to point
In-Reply-To: <11980@tsys.demon.co.uk>

On Tue, 26 Mar 1996, Tom Wheeley wrote:

> In article <01BB1A6C.CBC201A0@ppp001.free.org> you write:
>
> > BTW, I'm having a little trouble understanding how to figure the =
> > distance between (0,0,0) and a plane. If anyone could enlighten me on =
> > this subject I be really grateful.
>
> Eh? How is your plane definition stored? id store their planes:
>
> r.n-hat = d (n-hat is an `n' with a `^' circonflex (sp?) on top.)
>
> Where `d' _is_ the distance from (0,0,0) and `r' is a general point, and `.'
> is the scalar product (x1*x2+y1*y2+z1*z2). n-hat is the unit-vector stored
> at the beginning of each plane entry in the BSP, it is followed by `d'.
>
> It is hard to help without knowing just what information you do have about
> your plane.

I couldn't quite follow that, so maybe I can be of help...

You've got an equation for the plane

a*x+b*y+c*z+d=0

The distance from any point (x',y',z') to the plane should be given by

sqrt(a*x'+b*y'+c*z'+d)

But of course I could be mistaken (it has been quite a while...)

Zonk,
Uffe. [uphfe]
uffefl@diku.dk

--
"This .signature hasn't been left unintentionally void of blankness"