Point-Quadratic Distance
PointQuadraticCurve
To find the minimum distance between a point in the plane (x_0,y_0) and a quadratic plane curve
| y=a_0+a_1x+a_2x^2, |
(1)
|
note that the square of the distance is
r^2 = (x-x_0)^2+(y-y_0)^2
(2)
= (x-x_0)^2+(a_0+a_1x+a_2x^2-y_0)^2.
(3)
PointQuadraticDistance
Minimizing the distance squared is equivalent to minimizing the distance (since r^2 and |r| have minima at the same point), so take
| (partial(r^2))/(partialx)=2(x-x_0)+2(a_0+a_1x+a_2x^2-y_0)(a_1+2a_2x)=0. |
(4)
|
Expanding,
x-x_0+a_0a_1+a_1^2x+a_1a_2x^2-a_1y_0+2a_0a_2x+2a_1a_2x^2+2a_2^2x^3-2a_2y_0x=0
(5)
2a_2^2x^3+3a_1a_2x^2+(a_1^2+2a_0a_2-2a_2y_0+1)x+(a_0a_1-a_1y_0-x_0)=0.
(6)
Minimizing the distance to find the closest point (x^*,y^*) therefore requires solution of a cubic equation.
See also
Point-Line Distance--2-DimensionalExplore with Wolfram|Alpha
WolframAlpha
More things to try:
Cite this as:
Weisstein, Eric W. "Point-Quadratic Distance." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/Point-QuadraticDistance.html