Finding the minimum distance between two curves

  • Context: Undergrad 
  • Thread starter Thread starter Charles Link
  • Start date Start date
  • #31
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
  • #32
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:
  • Like
Likes   Reactions: anuttarasammyak
  • #33
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:
  • Informative
Likes   Reactions: Gavran
  • #34
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}.$$
 
  • Like
Likes   Reactions: Charles Link
  • #35
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.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 6 ·
Replies
6
Views
6K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 18 ·
Replies
18
Views
3K
Replies
5
Views
2K