Finding Smaller Euclidean Distance

128 Views Asked by At

This problem seems so simple that it must have been answered before, but I couldn't figure out what to search. Anyway,

Suppose you have the Euclidean distance between two points, $a$ and $b$, $z = \sqrt{x^2+y^2}$, where $x$ and $y$ are the differences, respectively, between the $x$ and $y$ co-ordinates of $a$ and $b$. Note that you do NOT know $a$ and $b$, only $z$. How do you find the value of $z' = \sqrt{(x-1)^2+(y-1)^2}$?

EDIT: Some people have (correctly) pointed out that I seem to be talking about distance from the origin. I wrote the original post in a hurry and didn't include a few clarifying details. Here is the full problem:

I have two rectangles in the plane and I want to find the minimum gap between them. I have a way (read: function) to get the minimum Euclidean distance between them, but the minimum gap is smaller than that (the gap between $(0,0)$ and $(0,2)$ is 1, the point $(0,1)$).

The $x$ and $y$ mentioned in my original problem were the difference vectors between the closest two points of the two rectangles, not as I originally said, the two points themselves.

2

There are 2 best solutions below

0
On BEST ANSWER

You can't. $\sqrt{x^2 + y^2}$ is the distance from $(x,y)$ to the point $(0,0)$. $\sqrt{(x-1)^2 + (y-1)^2}$ is the distance to the point $(1,1)$. But there infinitely many points with the same distance from $(0,0)$ (that is, lying on a circle with center $(0,0)$ and a fixed radius) that have different distances to the point $(1,1)$

2
On

Your question is "given that $(x,y)$ lies on some circle centered at the origin, how do I find the distance between $(x,y)$ and $(1,1)$?"

Answer: you don't. The only point in the plane that is equidistant from every point on a circle is the centre of the circle.