# Thread: Algorithm to find integer coordinates in 2-d plane at a distance 5 from each other

1. ## Algorithm to find integer coordinates in 2-d plane at a distance 5 from each other

Hi, my problem is as follows...I have calculated that the number of elements having integral coordinates, at a distance of upto 2 from any given point is 12, not counting the central element itself.

I would like an algorithmic construction to give me all sets of points at a distance 5 from each other, having integral coordinates , ie(3,4),(9,4),(0,0).

Golomb and Welch had given a similar construction for elements at a distance 3 from each other in the '71 paper on lee metric codes.

Kindly help me!!!

2. Originally Posted by pmalani88
I would like an algorithmic construction to give me all sets of points at a distance 5 from each other, having integral coordinates , ie(3,4),(9,4),(0,0).
I must be missing something; (3,4) is 5 from (0,0); ok;
but what's (9,4) doing there?
(9,4) is sqrt(97) from (0,0) and 6 from (3,4).

3. Yeah, so all three points (0,0) (3,4) , and(9,4) are at a distance of min. 5 from each other. More is also all right. There are several possible combinations of points. I just need an algorithm to give me any such combination of points, taking into account that each point is surrounded by 12 points whose distance is at most 2 from it(not including the point itself).

And thanks for the prompt reply