Point-Quadratic Distance

Eric W. Weisstein
January 11, 2002

This notebook downloaded from http://mathworld.wolfram.com/notebooks/PlaneGeometry/Point-QuadraticDistance.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/Point-QuadraticDistance.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Code

r2=(x-x0)^2+(a+b x+c x^2-y0)^2

D[r2,x]

vals={a->1,b->2,c->.6,x0->-1,y0->3}

ext=x/.{ToRules[NRoots[Evaluate[D[r2,x]==0 /. vals],x]]}

x1=ext[[-1]]

r2/.x->#&/@ext/.vals

y1=a+b x+c x^2/.x->x1;
ParametricPlot[{x,(a+b x+c x^2)/.vals},{x,-5,2},
Epilog->{{
{RGBColor[1,0,0],Line[{{x0,y0},{x1,y1}}]},
PointSize[.03],Point[{x0,y0}],Point[{x1,y1}]}/.vals},AspectRatio->Automatic]

r

Plot[Sqrt[(x-x0)^2+(a+b x+c x^2-y0)^2]/.vals,{x,-5,2},PlotRange->{-.1,5},
AxesLabel->TraditionalForm/@{x,r}]