Fundamental Mathematics from an Advanced Standpoint

Math 4303 - Fall 2009

Helmut Knaust, Department of Mathematical Sciences, UTEP, El Paso TX 79968
hknaust@utep.edu

Last Edits: 8/30/09

Parallel Curves According to Leibniz

The following module draws the two curves that are Leibniz-parallel to a given function. 
Input the function, the plot range and the distance at which the parallel curves are drawn. A last argument is optional and determines the number of steps used; the default is 100 steps.

Leibniz[fct_,{var_,start_,end_},dist_,steps__:100]:=Module[{f,vc,vc1,gr},f=Function[var,fct];vc[x0_]:=Line[{{x0,f[x0]},{x0-dist((f'[x0])/(Norm[{-f'[x0],1}])),f[x0]+dist(1/(Norm[{-f'[x0],1}]))}}];
vc1[x0_]:=Line[{{x0,f[x0]},{x0+dist((f'[x0])/(Norm[{-f'[x0],1}])),f[x0]-dist(1/(Norm[{-f'[x0],1}]))}}];
gr[x0_]:={{Red,vc[x0]},{Green,vc1[x0]},{Red,AbsolutePointSize[4],Table[Point[{y-dist((f'[y])/(Norm[{-f'[y],1}])),f[y]+dist(1/(Norm[{-f'[y],1}]))}],{y,start,x0,(end-start)/steps}]},{Green,AbsolutePointSize[4],Table[Point[{y+dist((f'[y])/(Norm[{-f'[y],1}])),f[y]-dist(1/(Norm[{-f'[y],1}]))}],{y,start,x0,(end-start)/steps}]}};Animate[Plot[f[x],{x,start,end},ImageSize->{{300,600},{300,600}},AxesLabel->{var,fct},AspectRatio->Automatic,BaseStyle->{14,Bold},PlotRangePadding->{{Max[dist/2,dist  Abs[f'[start]/Sqrt[1+f'[start]^2]]],Max[dist/2,dist  Abs[f'[end]/Sqrt[1+f'[end]^2]]]},dist},PlotRange->All,Epilog->gr[y]],{y,start,end,(end-start)/steps},AnimationRepetitions->1,AnimationRunning->True,DisplayAllSteps->True]]

Leibniz[x^2,{x,-1.5,1.5},1]

Leibniz[Cos[z],{z,0,2π},6,75]