Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I'm trying to implement a nearest neighbor search.

I have a set of points that lie within a rectangle of any size, and I need to map these points to the unit square such that the nearest neighbor relation between points is retained.

Is this possible, or will the mapping distort the relative distances between points?

For example, mapping the points inside of a 7 x 2 rectangle to the unit square.

share|improve this question
    
Well, if you extend the short sides of the rectangle to make a square, and map in the natural way, there will be no distortion of relative distances. But if the image of the original rectangle is exactly the unit square, there will be distortion. –  André Nicolas Dec 8 '12 at 3:43
    
Ok, that makes sense. Make this an answer and I'll accept it. –  Bryan Glazer Dec 8 '12 at 3:49

1 Answer 1

up vote 2 down vote accepted

Extend the short sides of the rectangle to make a square, and map in the natural way to the unit square. Then there will be no distortion of relative distances.

But if the image of the original rectangle is exactly the unit square, there will be distortion of relative distances unless the original points occupy very special positions. But we cannot arrange the mapping to that the image of the rectangle is the unit square and relative distances are preserved for all finite collections of points in the rectangle.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.