2

Given an ellipse, $E_1$ with radii $r_x, r_y$ I would like to know whether the minimum distance between any selected point, $P_a$, and $E_1$ is less than, say $D$.

I have seen the related question of finding the distance between a point and an ellipse. Rather than finding that minimum distance, I would like to solve it differently by creating an ellipse, $E_2$ with radii $r_x + D, r_y + D$ and then test whether the point $P_a$ falls within $E_2$, which is easy to do.

So, my question is, if the point $P_a$ falls within $E_2$, does it mean that the minimum distance between $E_1$ and $P_a$ is less than $D$?

Matt
  • 123

2 Answers2

4

Pictured below are

  • [Red] The (degenerate) ellipse $E_1$ with axes $1$ and $0$.
  • [Green] The set of points exactly one unit from $E_1$.
  • [Blue] The ellipse $E_{1+1}$ with axes $1+1$ and $0+1$.

All points within $E_{1+1}$ are within one unit of $E_1$ , but the converse is false. There are points within one unit of $E_1$ that don’t lie within $E_{1+1}$.

enter image description here

Here’s a picture showing the “correct” (go out a distance $d$ perpendicular to the ellipse) and “approximate” (go out to an ellipse with axes larger by $d$) curves at two distances ($2$ and $6$) from one quarter of an original ellipse with axes $3$ and $1$. At least I hope it’s the right picture! As Matt suspected, the approximation is not bad at all.

enter image description here

Steve Kass
  • 15,314
  • 1
    I think it’s also worth mentioning that the idea of “concentric ellipses” is a bit tricky. Increasing each axis of an ellipse by a distance $d$ doesn’t produce an ellipse with the same shape, and the set of points $d$ units further from an ellipse’s center than on the ellipse is not an ellipse. – Steve Kass Aug 19 '16 at 23:55
  • 1
    achille's answer shows why all the points on $E_2$ will be within at least $D$ of points on $E_1$. However, as you point out, not all points at a distance $D$ from $E_1$, on a line normal to $E_1$ will fall within $E_2$. But I don't think it'd be quite as extreme as your image for most curves. So I think using $E_2$ to approximate closeness to $E_1$ will be good enough for most user interactions in my paint app. – Matt Aug 20 '16 at 00:16
  • I managed to graph the situation for a more typical case. I’ll add the picture to my answer. – Steve Kass Aug 20 '16 at 01:12
1

For any point $p \in E_2$, the minimal distance between $p$ and $E_1$ is at most $D$.

For any point $p$ on $\partial E_2$, the boundary of ellipse $E_2$, one can find a $\theta \in [0,2\pi)$ such that

$$p = (( r_x + D)\cos\theta, (r_y + D)\sin\theta)$$ Consider the corresponding point $q = (r_x \cos\theta, r_y \sin\theta)$ lying on $\partial E_1$, the boundary of ellipse $E_1$. Since the distance between $p$ and $q$ is $D$, we have

$$\verb/dist/( p, E_1 ) = \inf \{ \verb/dist/(p,r) : r \in E_1 \} \le \verb/dist/(p,q) = D$$ So the minimum distance of $p$ from $E_1$ is at most $D$. The whole $\partial E_2$ is within a distance $D$ from $E_1$.

Since $E_1$ is convex, so does the set of points within a distance $D$ from $E_1$. Since $E_2$ is convex and points inside $E_2$ lies on some line segment ending at $\partial E_2$, every point on that line segment will be within a distance $D$ from $E_1$. This implies the whole $E_2$ is within a distance $D$ from $E_1$.

achille hui
  • 125,323