# comp.graphics.algorithms

## Subject: Re: nearest neighbour of a point

[You keep blowing up the F'up2 list back to all three groups you
originally crossposted this to. Please don't.]

In comp.graphics.algorithms running.polygon@gmail.com wrote:
> I was wondering if I could use some method that uses vectors & dot
> products.

You already are, all the time, without noticing that.

Euclidean distance, *is*, for all practical means and purposes, an
application of the dot product. It's

sqrt( (V1 - V2) . (V1 - V2) )
= sqrt( V1^2 + V2^2 - 2 * V1.V2 )

This is the extension of trigonometry's Cosine Theorem to arbitrarily
many dimensions.

> So, is there any way I can compute the dot product vector
> efficiently.

None that gain you very much compared to the Euclidean distance itself.

> What is the significance of THETA(the angle in the dot product
> expression) in n-dimensions.

The same as in 3D: It's the angle between two vectors in the
(hyper-)plane spanned by them. It's the angle of a rotation that
brings one to the other, while leaving the other N-2 dimensions of a
suitable arranged coordinate system alone.

> If in n-dimensions, 2 vectors have angles T1 & T2 from a reference
> vector, say: {1, 1, 1}, then can we perform addition & subtraction on
> the 2 angles?

No. That already fails in 3 dimensions. Angles don't add outside a plane.

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.