Use 3d pythagorean theorem.

the distance d between point1 (x1,y1,z1) and point2 (x2,y2,z2) is...

d = sqrt((x1-x2)^2 + (y1-y2)^2 + (z1-z2)^2)

as for building an index for this? i have no idea. but that is how you find the distance between two 3D points.

b

Jose Antonio wrote:
MySQL offers Spacial Extensions to operate with points in a 2 dimensional
space.

For a project I'm working on, I need to work with points in an N dimensional
space and measure the distance among them. Is there a clever do to solve the
following problem?:

Let's say I have 4 3D point (X,Y,Z):

(0,0,0), (1,1,1), (4,4,2), (-2,30,18)

And for a new point (3, -1, 1.5), I need to know which of my other points
are closer and what the distance is.

Any clues?

Thank you in advance,
Jose.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to