Sourabh N said:
You are absolutely correct. A bit of manipulation will end you up the same thing I was telling (slope = -1).
I disagree, unless I'm totally not understanding what is going on. Look at this simple example: http://www.hostdump.com/uploads/212436219e.jpg
The maximum distance from (x
0, y
0) to the curve is a vertical line - the slope of the curve is zero,
not -1. It is problem dependent. Certainly there are specific problems where it is true, but not in general.
temp,
What said before I believe is correct. Write the expression for distance from the reference point to the curve, take the derivative with respect to t, set = zero, and solve (the resulting cubic equation) for t. In the case of the specific posted example, t = 0.5, which means x = 0, y = -1.
d^2 = (x-x_0)^2 + (y-y_0)^2
d(d^2)/dt = 0 = 2(x-x_0)x'+ 2(y-y_0)y' = (x-x_0)x'+ (y-y_0)y'
0 = (a_xt^2+ b_xt + c_x - x_0)(2a_xt + b_x) + (a_yt^2+ b_yt + c_y - y_0)(2a_yt + by)
0=2t^3(a_x^2+a_y^2)+3t^2(a_xb_x+a_yb_y)+t(2a_xc_x-2a_xx_0+b_x^2+2a_yc_y-2a_yy_0+b_y^2)+b_xc_x-b_xx_0+b_yc_y-b_yy_0
For the specific problem posted, the cubic to be solved is:
0 = 32t^3 - 48t^2 + 12t + 2
The 3 solutions are:
t = (-0.112, 0.5, 1.112)
There is only 1 value of t within the desired range of t=0,1 and that's t = 0.5, which is the point of maximum distance from (x
0, y
0). The other 2 values of t represent minimum distance.
Like I said before, the key to this problem is solving a cubic equation - that can be done analytically or numerically. Here is a more complicated example: http://www.hostdump.com/uploads/2c1856190f.jpg