Find the nearest point

406 Views Asked by At

How can I find the nearest point of the set(M) to the point (A) in GENERAL(with different set or in 3D space )? enter image description here

2

There are 2 best solutions below

0
On

In GENERAL you need to find equation for the border of the set: it's either a curve in 2D or a surface in 3D. Then plug it into equation for distance between two points - one point is your A, as the second point you put in the equation of the border. Then you have to minimise the obtained formula - eg. using calculus.

0
On

Let $A\in\mathbb R^n$, $M\subset\mathbb R^n$, $S=\{|A-x|:x\in M\}$ and $f(x)=|A-x|$ for $x\in\mathbb R^n$. The distance from $A$ to $M$ is $d(A,M):=\inf\{f(x):x\in M\}$. In general, there need not be a "nearest point," that is, a point $x^\star\in M$ such that $f(x^\star)=d(A,M)$. For a counterexample, let $M$ be the open unit ball and $A$ a point not in $M$.

An important observation to make is that if $x$ is a nearest point, then it lies on the boundary of $M$. For otherwise there is an open ball centered at $x$ contained in $M$, and any point on the line segment with ends $A$ and $x$ and in that open ball is closer to $A$ than $x$.

Now, $f$ is continuous, as for any $\varepsilon>0$, $|x-y|<\varepsilon$ implies that $$|f(x)-f(y)| = |A-x-(A-y)|=|x-y|<\varepsilon.$$ So if $M$ is closed and bounded, then it is compact by the Heine-Borel theorem, and so $S$ is compact as the continuous image of a compact set. It follows that $S$ is closed and bounded, so that $S$ has a minimum element $s^\star$, and so the point(s) in $M$ closest to $A$ are the elements of $$f^{-1}(\{s^\star\}) = \{x\in\mathbb M: f(x) = d(A,M)\}. $$

Another sufficient condition for a nearest point to exist is for $M$ to be closed and convex. This follows from the Hilbert Projection Theorem.