# Thread: Shortest distance between 2 curves

1. ## Shortest distance between 2 curves

Find the shortest distance between,

$\displaystyle y = x^{2}-8x+15$

and

$\displaystyle 2y + 7 + 2x^{2} = 0$

We can say that the vector perpendicular to the tangent vector of each curve, $\displaystyle \vec{d}$, is described as follows,

$\displaystyle \vec{d} = a\hat{i} + b\hat{j} + c \hat{k}$

Now if I could get my two curves in the form of a position vector, I can differentiate both position vectors to obtain their tangent vectors.

Once I have their tangent vectors (Let's say vectors $\displaystyle \vec{u}$ and $\displaystyle \vec{v}$) I can cross them with my vector $\displaystyle \vec{d}$ and equate them to 0.

But how do I get my curves in the form of a position vector?

And even after all this, I've only got 2 equations, so I need another one! Where can I find that last equation?

EDIT:

$\displaystyle \vec{r_{1}(t)} = t\hat{i} + (t^{2} - 8t +15)\hat{j}$

$\displaystyle \vec{r_{2}(t)} = t\hat{i} + (-t^{2} - \frac{7}{2})\hat{j}$

How do those look for position vectors of my curves?

2. If I were you, I would dot the tangent vectors with the vector $\displaystyle \vec{d}.$ You want the normal vector $\displaystyle \vec{d}$ to be orthogonal, not parallel, to the tangent vectors. If you do this, you'll only need a 2-dimensional vector $\displaystyle \vec{d}$. You'll have two dot products equalling zero, hence two equations with two unknowns. Turn the crank.

3. Originally Posted by Ackbeet
If I were you, I would dot the tangent vectors with the vector $\displaystyle \vec{d}.$ You want the normal vector $\displaystyle \vec{d}$ to be orthogonal, not parallel, to the tangent vectors. If you do this, you'll only need a 2-dimensional vector $\displaystyle \vec{d}$. You'll have two dot products equalling zero, hence two equations with two unknowns. Turn the crank.
Okay so for my tangent vectors,

$\displaystyle \vec{v_{1}(t)} = \hat{i} + (2t -8)\hat{j}$

$\displaystyle \vec{v_{2}(t)} = \hat{i} + (-2t)\hat{j}$

Now if I dot my first tangent vector with $\displaystyle \vec{d}$,

$\displaystyle \vec{v_{1}(t)} \cdot \vec{d} = a + (2t - 8)b = 0$

$\displaystyle \vec{v_{2}(t)} \cdot \vec{d} = a + -2tb = 0$

This gives me 2 equations with 3 unknowns (I don't know t).

4. Hmm. In working through things, I discovered that you actually have 4 unknowns. It turns out that you can't assume the parametrization of your two curves have the same x value. That is, you really ought to have

$\displaystyle \vec{r}_{1}(t) = t\hat{i} + (t^{2} - 8t +15)\hat{j}$ and
$\displaystyle \vec{r}_{2}(s) = s\hat{i} + (-s^{2} - \frac{7}{2})\hat{j}$

The two extra equations you get come from the fact that the two points corresponding to $\displaystyle t$ and $\displaystyle s$ must lie on their respective curves. Does that make sense?

5. Yes. That makes perfect sense.

But now I'm going to need 2 more equations, correct? Where can I get those?

6. How about this: If I go from the origin to the point $\displaystyle \vec{r}_{1}(t),$ and then go in the direction of $\displaystyle \vec{d}$ a distance of $\displaystyle \|\vec{d}\|,$ where should I end up?

7. Originally Posted by Ackbeet
How about this: If I go from the origin to the point $\displaystyle \vec{r}_{1}(t),$ and then go in the direction of $\displaystyle \vec{d}$ a distance of $\displaystyle \|\vec{d}\|,$ where should I end up?
at $\displaystyle \vec{r_{2}(s)}$ no?

Are you trying to say that,

$\displaystyle \vec{r_{1}(t)} + \vec{d} = \vec{r_{2}(s)}$ ?

8. There you go. And since that's a vector equation with two components, you have two equations, right?

9. Alright, so now its down to solving 4 equations with 4 unknowns.

There's no easy way to do this is there :S ?

10. Hehe. I'm working through it now myself. Incidentally, I don't think I really understood how to solve this problem when I first started replying. I've been learning as I go.

The system of equations is nonlinear, so doing ERO's is not going to work. I'd recommend substitution methods. Also, remember that the trivial solution a=b=0 is not allowed. That might be important in simplifying certain expressions.

First step: write out all your equations.

11. Originally Posted by Ackbeet
Hehe. I'm working through it now myself. Incidentally, I don't think I really understood how to solve this problem when I first started replying. I've been learning as I go.

The system of equations is nonlinear, so doing ERO's is not going to work. I'd recommend substitution methods. Also, remember that the trivial solution a=b=0 is not allowed. That might be important in simplifying certain expressions.

First step: write out all your equations.
Here are my equations in order

$\displaystyle a + (2t - 8)b = 0$ Equation 1.

$\displaystyle a - 2sb = 0$ Equation 2.

$\displaystyle s = a + t$ Equation 3.

$\displaystyle -s^{2} - \frac{7}{2} = b + t^{2} - 8t + 15$ Equation 4.

How's this look?

12. Correct so far. What next?

13. I'm not really sure... I can't think of an efficient way of solving these. Any ideas?

14. Try the substitution method: solve one equation (say, 2) for one variable. Once you've done that, plug in that expression in the other three equations.

15. Okay from equation 2,

a = 2sb

then I'll have the equations,

$\displaystyle 2sb + (2t-8)b = 0$

$\displaystyle 2sb + t = s$

$\displaystyle -s^{2} - \frac{7}{2} = b + t^{2} - 8t + 15$

Now if I use the 2nd equation in this post,

$\displaystyle t = s - 2sb$

So then I'll have these 2 equations,

$\displaystyle 2sb + (2s - 4sb -8)b = 0$

$\displaystyle -s^{2} - \frac{7}{2} = b + (s-2sb)^{2} - 8s + 16sb + 15$

Seems to be going okay so far hopefully...

Now solving for s in that first equation,

$\displaystyle s = \frac{2b}{b-b^{2}}$

Now I've plugged this into the last remaining equation so I have it in terms of b on paper, but its so messy I don't see how I can solve it.

Page 1 of 2 12 Last