Finding the minimum distance between two curves

  • Context: Undergrad 
  • Thread starter Thread starter Charles Link
  • Start date Start date
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
35 replies · 9K views
anuttarasammyak said:
I got x1=1.8317... x2=2.5421...
Excellent. By @Gavran's method, I have ## x_2=\frac{a}{5}+\frac{12}{5} \approx 2.54 ##. :) (see also posts 24, 25, 29, and 30).

Note: In the OP and the first several posts following it, we solved for the minimum distance between ## y=4-x^2 ## and ## y=(x-3)^2 ##. In these last couple of posts we are solving for the minimum distance between ## y=4-x^2 ## and ## y=(2x-6)^2 ##.
 
Last edited:
Physics news on Phys.org
anuttarasammyak said:
Find the two points that share the same normal line. It would be a general way as @pasmith showed.
Yes, this way seems to get the result a little easier. I worked the ## y=4-x^2 ## and ## y=(2x-6)^2 ## problem by this method just now, and it does seem somewhat easier than other methods. i.e. Find the two points with same slopes that share the same normal line.

@anuttarasammyak I see your additions to post 30 including a couple graphs. Excellent. :)
 
Last edited:
Reply
  • Like
Likes   Reactions: anuttarasammyak
Note: @Gavran 's method (post 15 above) needs a second power form to take the discriminant. @pasmith 's method works in the general case.

The two methods are otherwise very similar. @Gavran sets both slopes the same and sets these to the slope of the normal line, just like @pasmith . @Gavran then translates one curve in the direction of the other, and has them make contact at one point. @pasmith is a slightly easier route by not needing this extra step.

@pasmith (post 11) basically has ## y_1'(x_1)=y_2'(x_2)=-(\frac{x_2-x_1}{y_2(x_2)-y_1(x_1)}) ##. where the slopes are set the same and set equal to the slope of the normal line between them connecting ## (x_1,y_1) ## and ## (x_2,y_2) ##. This seems to be the simplest and a most general way to work problems of this kind.

@pasmith has this in his post for the most part, but doesn't spell it out in this simple form. He did a couple algebraic steps to get a result, in hindsight, we know that had to be the case.

@anuttarasammyak previously mentioned this as well, (post 26), but I thought I would write it out in its simplest form.

Looking over the posts, I actually spotted these two results in post 8, of the same slopes, and being perpendicular to the normal line between the points, but it wasn't until later, e.g. @anuttarasammyak of post 26 that we started to see that these two results would indeed be a simple solution to the general case. :)
 
Last edited:
Reply
  • Informative
Likes   Reactions: Gavran
One can always resort to the Newton-Raphson method to solve ##\mathbf{f}(\mathbf{x}) = \nabla L = 0## by iteration, where each step requires solving the linear system $$
J(\mathbf{x}_n)\mathbf{u} = -\mathbf{f}(\mathbf{x}_n)$$ for ##\mathbf{u} = \mathbf{x}_{n+1} - \mathbf{x}_n## where $$J = \begin{pmatrix} \frac{\partial^2 L}{\partial x_1^2} & \frac{\partial^2 L}{\partial x_1\,\partial x_2} \\ \frac{\partial^2 L}{\partial x_2\,\partial x_1} & \frac{\partial^2 L}{\partial x_2^2} \end{pmatrix}.$$
 
Reply
  • Like
Likes   Reactions: Charles Link
I think I basically did that solving the cubic by linear approximation to first order, where once I got a solution, I could get an improved approximation by taking the first solution and adding another delta to it, and solving it once again for the new delta to first order. This can be done repeatedly, and is really a simple process.
 
I want to repeat something from post 33 for those who might have missed it:

See:

@pasmith (post 11) basically has ## y_1'(x_1)=y_2'(x_2)=-(\frac{x_2-x_1}{y_2(x_2)-y_1(x_1)}) ##. where the slopes are set the same and set equal to the slope of the normal line between them connecting ## (x_1,y_1) ## and ## (x_2,y_2) ##. This seems to be the simplest and a most general way to work problems of this kind to find the minimum distance between two curves.
 
Last edited: