Distance from the origin to the curve

  • Thread starter Thread starter physicsCU
  • Start date Start date
  • Tags Tags
    Curve Origin
physicsCU
Messages
198
Reaction score
1
Anyone know the formula to find the minimum distance from the origin to the curve, and find that point on the curve that is the minimum distance from the origin.

This is for a programming problem in MATLAB, so thanks for any help!

EDIT: By the way, I don't know the points on the curve, so i need to minimize the distance using points that i need to determine.
 
Last edited:
Physics news on Phys.org
Use the distance formula: D = \sqrt{(y_2-y_1)^2 + (x_2-x_1)^2}.

Differentiate and solve for the shortest distance.
 
Jameson said:
Use the distance formula: D = \sqrt{(y_2-y_1)^2 + (x_2-x_1)^2}.

OK, I got the D, but both x and y are described as functions of time, so how do I get t?
 
X and Y are the coordinates of the curve. Actually, since one point is the origin you can rewrite the equation as:

D = \sqrt{(y_1)^2 + (x_1)^2}

This is because the point (0,0) has no effect on the answer if you put it in.

------
You said you wanted to know how to find the shortest possible distance from the point to the curve, why are you talking about time? i don't understand the question.
 
It is easier to work with the squared distance, rather than the distance.
 
So, putting together the ideas of Jameson and arildno, Let x = x(t), y = y(t), then

F = D^{2} = (x(t))^{2} + (y(t))^{2}

Take the derivative of F with respect to t and set it to zero.

The time at which the minimum distance is attained will be one of the values of t that satisfy the resulting equation, call it t_{m}. The point at which the minimum distance is attained will be (x(t_{m}), y(t_{m})) and the minimum distance will be:

\sqrt{(x(t_{m}))^{2} + (y(t_{m}))^{2}}
 
Last edited:
I found the output D, but I need to find the input.

However, this is a programming problem, not a calculus problem, so I have to figure out the code.
 
jimmysnyder said:
So, putting together the ideas of Jameson and arildno, Let x = x(t), y = y(t), then

F = D^{2} = (x(t))^{2} + (y(t))^{2}

Take the derivative of F with respect to t and set it to zero.

The time at which the minimum distance is attained will be one of the values of t that satisfy the resulting equation, call it t_{m}. The point at which the minimum distance is attained will be (x(t_{m}), y(t_{m})) and the minimum distance will be:

\sqrt{(x(t_{m}))^{2} + (y(t_{m}))^{2}}

You explained it correctly, you need to take the derivative and set it equal to zero. So why did you say the minimum distance was \sqrt{(x(t_{m}))^{2} + (y(t_{m}))^{2}}? I just don't understand and would like clarification if possible.

You differentiate x^2 + y^2 and set it equal to zero, getting
2x + \frac{dy}{dx} * 2y = 0
 
Differentiate with respect to t.
 

Similar threads

Back
Top