Exploring Analyic Geometry with Mathematica® |
|||||
| Home | Contents | Commands | Packages | Explorations | Reference |
| Tour | Lines | Circles | Conics | Analysis | Tangents |
Normals and Minimum Distance
normal.html
Exploration
Given a point
and a quadratic Q, find the point(s) P(x,y) on Q such that the line
is perpendicular to the line tangent to Q at P. Such a line
is called a normal to the quadratic. Use the points P to find the minimum distance from
to Q. Assume that
and Q are defined numerically.
Approach
The point P(x,y) is clearly on Q, so P must satisfy the equation for Q. In addition, since the normal line
is perpendicular to the tangent line, its slope must be the negative reciprocal of the tangent line's slope. The tangent line is the polar of P with respect to Q. These two equations can be solved simultaneously for the (x,y) coordinates of the point P.
Initialize
To initialize Descarta2D, select the input cell bracket and press SHIFT-Enter.
This initialization assumes that the Descarta2D software has been copied into one of the standard directories for AddOns which are on the Mathematica search path, $Path.
<<Descarta2D`
Solution
Define a function to construct the point(s) P based on the approach described above.
NormalPoints2D[
P0:Point2D[{x0_,y0_}],
Q:Quadratic2D[a_,b_,c_,d_,e_,f_]]:=
Module[{P,x,y,ln,eq1,eq2,ans},
eq1=Equation2D[Q,{x,y}];
P=Point2D[{x,y}];
ln=Line2D[P,-1/Slope2D[Line2D[P0,P]]];
eq2=TangentEquation2D[ln,Q];
ans=Solve2D[{eq1,eq2},{x,y}];
ans=Select[ans,(IsReal2D[x /. #] &&
IsReal2D[y /. #])&];
Map[(P /. #)&,ans]] /;
IsNumeric2D[{P0,Q},NormalPoints2D]
Define a function to construct the normal lines using the normal points.
NormalLines2D[
P0:Point2D[{x0_,y0_}],
Q:Quadratic2D[a_,b_,c_,d_,e_,f_]]:=
Map[Line2D[#,Q]&,NormalPoints2D[P0,Q]] /;
IsNumeric2D[{P0,Q},NormalLines2D]
Select the minimum distance from the normal point(s).
MinimumDistance2D[
P0:Point2D[{x0_,y0_}],
Q:Quadratic2D[a_,b_,c_,d_,e_,f_]]:=
Min[Map[Distance2D[P0,#]&,NormalPoints2D[P0,Q]]] /;
IsNumeric2D[{P0,Q},MinimumDistance2D];
Discussion
Here we illustrate the solution with a numerical example.
p0=Point2D[2.,2.];
q1=Quadratic2D[Ellipse2D[{0,0},2,1,0]];
pts=NormalPoints2D[p0,q1]
lns=NormalLines2D[p0,q1]
Sketch2D[{p0,pts,lns,q1}, CurveLength2D->6]
Graphics saved as "normal01.eps".
MinimumDistance2D[p0,q1]