Message Boards Message Boards

0
|
4535 Views
|
6 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Distance between a point and others is an integer

Posted 3 years ago

I have 4 points in a 2D plane

{{0, 0}, {20, 0}, {138/5, (24 Sqrt[6])/5}, {25, 10 Sqrt[6]}}

and wish to find a 5th point such that the distances to the 4 points is an integer.

I have tried solving for a point to the point {138/5, (24 Sqrt[6])/5}, specifying Integer elements and reals and cannot get any specific point as an answer, it's all conditionally based. Satisfying 4 points simultaneously seems unobtainable. My question is, is this solvable using Mathematica's built in functions? Or do I resort to a programmable approach?

Btw the pairwise distances between those 4 points are Integer.

POSTED BY: Paul Cleary
6 Replies

Each of the points has integer distance from the others. This finds a new point with integer distances from the other four:

pts = {{0, 0}, {20, 0}, {138/5, (24 Sqrt[6])/5}, {25, 10 Sqrt[6]}};
dists = MapIndexed[({x, y} - #) . ({x, y} - #) == d[#2[[1]]]^2 &, 
  pts]
eqs = Eliminate[dists, {x, y}]
instc = FindInstance[
  eqs && d[1] > 0 && d[2] > 0 && d[3] > 0 && d[4] > 0, Array[d, 4], 
  Integers]
Solve[dists /. instc[[1]]]
POSTED BY: Gianluca Gorni
Posted 3 years ago

Gianluca, Thank you, that does indeed find another point, it is unfortunate that the point is co-linear with 2 of the lines and would be an invalid solution to my problem, but I am sure I can adapt. Thanks again.

POSTED BY: Paul Cleary
Posted 3 years ago

If I am not certain whether there is a solution then I try minimize and see whether the result is near zero

p={{0, 0}, {20, 0}, {138/5, (24 Sqrt[6])/5}, {25, 10 Sqrt[6]}};
NMinimize[Plus@@Map[Norm[{x,y}-#]&,p],{x,y}]

which returns

{55.,{x->21.9047,y->9.33135}}

That is no guarantee that it didn't get trapped in a local minimum

POSTED BY: Bill Nelson
Posted 3 years ago

Bill, Thank you, an interesting idea, though I am not too sure how to interpret the output in relation to my problem.

POSTED BY: Paul Cleary

So, what exactly do you want? As you wrote, satisfying all four equations seems unreachable. And even more, I am quite sure that one can prove that the requested point does not exist using Mathematica built-ins:

ClearAll[x, y, n, points, eqns]
points = {{0, 0}, {20, 0}, {138/5, (24 Sqrt[6])/5}, {25, 10 Sqrt[6]}};
eqns = And @@ Table[Norm[{x, y} - point] == n, {point, points}];
Solve[
    eqns && And[Element[x, Reals], Element[y, Reals], Element[n, Integers]],
    {x, y, n}
]

These lines return an empty list which means that there's no solution with the required properties. Relaxing the constraint for n yields a unique solution:

Solve[
    eqns && And[Element[x, Reals], Element[y, Reals], Element[n, Reals]],
    {x, y, n}
]

The result is a list {{x -> 10, y -> 145/(4 Sqrt[6]), n -> 175/(4 Sqrt[6])}}. It does not sound probable that there's a second, "integer" solution to this problem which was not detected by the Solve function.

So, is it what you are looking for?

POSTED BY: Nikolay Shilov
Posted 3 years ago

Nikolay, Thank you, the proof that a point doesn't exist is all I need.

Edit.. I have had time to analyse your code and realised you were trying to find a point that was equidistant from the 4 given points, so perhaps I should have been more specific in my question, I am in fact trying to find a point that has all 4 distances integer and distinct, and if I was to be precise also distinct from the 6 pairwise distances given. Sorry for the confusion.

POSTED BY: Paul Cleary
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract