Example 7.2.2

This notebook generalizes the display of curvature and osculating circle for a two-dimensional curve as given in example 7.2.2 of the text.  Simply enter a parametric curve, the starting and ending values for the parameter t, and you will get 2 different graphs.  One is the graph of the curve itself, together with the osculating circle at a point (the point on the curve is controlled by the slider).  The second graph graphs only the value of the curvature and indicates where on the graph the current point in the curve is.  Remember, since the radius of the osculating circle is the reciprocal of the curvature, larger curvature values should lead to smaller circles.

Note:  You must use t as the parameter here, so make sure you haven't defined t to be a specific number.

OsculatingCirclein2D[ curve_, {t_,a_,b_},t0_]:=
Block[ {curvature, radius,center,graphics,k,x,y,xmin,xmax,ymin,ymax,pts,r,normal, n,tangent,ptoncurve,maxcurvature},
x=curve[[1]];y=curve[[2]];
curvature=Abs[ D[x,t]D[y,t,t]-D[y,t]D[x,t,t]]/(D[x,t]^2+D[y,t]^2)^(3/2);
tangent=D[curve,t]/Sqrt[D[curve,t].D[curve,t]];
normal=D[tangent,t]/Sqrt[D[tangent,t].D[tangent,t]];
radius = 1/curvature;
pts=Transpose[Table[ curve,{t,a,b,(b-a)/50}]];
{xmin,xmax}={Min[pts[[1]] ]-.5, Max[pts[[1]] ]+.5};
{ymin,ymax}={Min[pts[[2]] ]-.5, Max[ pts[[2]] ]+.5};
maxcurvature=Max[Table[curvature,{t,a,b,(b-a)/50}]]+.5;
r=radius /. t-> t0;
n=normal/. t->t0;
k=curvature /. t->t0;
ptoncurve=curve/. t->t0;
center = ptoncurve+1/k n;
graphics={PointSize[.03], Point[ ptoncurve], Red,Point[ ptoncurve+1/k n], Circle[center ,r], Line[{ptoncurve,center}]};
Column[ {Show[ParametricPlot[curve,{t,a,b},PlotLabel->StringJoin["The current point is ",ToString[Chop[ptoncurve]]]], Graphics[graphics], PlotRange->{{xmin,xmax},{ymin,ymax}},AspectRatio->Automatic, ImageSize->275],
Show[Plot[curvature, {t,a,b}, PlotLabel-> StringJoin["The current curvature is ", ToString[k]]],Graphics[{Red,Line[{{t0,0},{t0,maxcurvature}}]}] ,ImageSize->225  ]}]
];

Manipulate[OsculatingCirclein2D[curve,{t,a,b},a+u(b-a)],{{curve,{2Exp[-.2t]Cos[t],2Exp[-.2t]Sin[t]},"Curve formula"}},{{a,0 ,"Parameter start value"}},{{b,4Pi, "Parameter end value"}},{{u,0,"Point slider"},0,1,.01}, SaveDefinitions->True]