1

For a hobby project gone too far, I'm trying to find the maximum separation between two ellipses. I have only a high-school-graduate-level grasp of algebra and calculus, and am happy to dig deeper than that... but I need some guidance.

I have 3 functions of the same form, $X(p, q)$, $Y(p, q)$, and $Z(p, q)$ for which I am trying to evaluate $p$ and $q$. I know that $X+Y+Z=0$. I know I need to express p and q in terms of each other, but as you can see below, the three functions together are quite complex. I've been futzing around with trig identities to try and isolate either variable, but am stuck. Perhaps fresh eyes will help; can anyone here see a way forward?

All values are known, except $p$ and $q$.

$X(p,q) = [b_1V_{x1}\cos(p)-a_1U_{x1}\sin(p)][(C_{x2}+a_2U_{x2}\cos(q)+b_2V_{x2}\sin(q))-(C_{x1}+a_1U_{x1}\cos(p)+b_1V_{x1}\sin(p))]$

$Y(p,q) = [b_1V_{y1}\cos(p)-a_1U_{y1}\sin(p)][(C_{y2}+a_2U_{y2}\cos(q)+b_2V_{y2}\sin(q))-(C_{y1}+a_1U_{y1}\cos(p)+b_1V_{y1}\sin(p))]$

$Z(p,q) = [b_1V_{z1}\cos(p)-a_1U_{z1}\sin(p)][(C_{z2}+a_2U_{z2}\cos(q)+b_2V_{z2}\sin(q))-(C_{z1}+a_1U_{z1}\cos(p)+b_1V_{z1}\sin(p))]$

Edit - A couple threads I've been trying to springboard off of:

  1. Furthest distance between two circles in 3D
  2. How to calculate minimum distance between two arbitrary ellipses in 2D
  3. Solving trigonometric equations of the form $a \sin x + b \cos x = c$

I arrived here by taking the partial derivatives of the distance function for two points, one on each ellipse. Once I can find the critical points from that, I should have my solution(s).

The distance function is from the ellipses' parametric equations:

$x(θ)=C_x+aU_x\cos(θ)+bV_x\sin(θ)$

$y(θ)=C_y+aU_y\cos(θ)+bV_y\sin(θ)$

$z(θ)=C_z+aU_z\cos(θ)+bV_z\sin(θ)$

(Where $C$ is the centrepoint of the ellipse, $a$ and $b$ are its semimajor and semiminor axes, respectively, and $U$ and $V$ are unit vectors defining the plane of the ellipse. Angle $θ$ describes position on the ellipse)

So the distance function is:

$$D=\sqrt{(x_1-x_2)^2+(y_1-y_2)^2+(z_1-z_2)^2}$$

As the derivative of $\sqrt{n}$ is ${n'\over2\sqrt{n}}$, I only need concern myself with where the numerator ($n'$) is equal to $0$:

$$n'=-2f'(p)[-f(p)+j(q)]-2g'(p)[-g(p)+k(q)]-2h'(p)[-h(p)+l(q)]$$

(Where functions $f$, $g$, and $h$ refer to the parametrics for the 1st ellipse, and functions $j$, $k$, and $l$ to those for the 2nd. $p$ and $q$ are used instead of $θ$)

$n'=0$ is essentially of the form $0=X+Y+Z$ as outlined above.

Syntax
  • 21
  • I suspect it be easier if you use the result that normal vectors must point straight to each other. But I'm not sure. – mathreadler May 05 '18 at 18:46
  • @mathreadler Are you referring to gradients? I think you may be on to something, and I think the Lagrange multiplier method leverages what you're talking about. But I am still only grasping at straws. – Syntax May 05 '18 at 18:56
  • This problem won't be easy. Just finding the distance between a point and an ellipse leads to a quartic equation in the planar case. WLOG, you can assume that one of the ellipses is reduced in the form $x=a\cos\theta,y=b\sin\theta,z=0$. –  May 05 '18 at 19:17
  • @Syntax: the normal lines to the differentiable manifolds should point straight at each other for the two pairs of points which are closest to each other on the respective shape. – mathreadler May 05 '18 at 19:20
  • @mathreadler I really hope there is an easier (or... more basic) way, even if it is more brute force and less elegant than one using differentiable manifolds. That looks to be well beyond my level of curious-high-school-graduate. :/ – Syntax May 05 '18 at 19:38
  • You should also be able to solve it with multivariable calculus. For example difference of points as functions of $\theta_1,\theta_2$, but I don't see how to solve it with anything less than two variable calculus. But if you are curious enough in high school it should not be particularly impossible for you to learn. – mathreadler May 05 '18 at 19:47

0 Answers0