ch3.org.uk

Get Firefox!

Just a little radical?

N-dimensional geometric proximity

2005-09-08 14:46:00
For reasons likely to bore, I need to write an algorithm that includes finding the distance between two points in an N-dimensional geometric phase space.

Now I know that in 2D the distance from x1,y1 to x2,y2 is sqrt((x1-x2)^2 + (y1-y2)^2), but all the maths they failed to teach me at Uni has drained away, meaning I can't remember the algorithm for higher dimensions.

I have a vague memory that the 3D equivalent should be sqrt((x1-x2)^2 + (y1-y2)^2 + (z1-z2)^2). Is that right or do I need to deal in higher powers? Is it always square root(sum of squares)?

Post new comment

Subject:
Your name:
Your email:
The number above:
Hide email address:
Email me replies:
Format: [TEXT]
Message:

<< First | < Previous | Next > | Last >>