Chapter 1 - An Introduction to Mathematica

Section 1.5 - Plotting and Animations

f[x_]=x Sin[(x^2) (E^x)]

Plot[f[x],{x,-1,2},PlotStyle->Red,PlotRange->{-2,2}]

g=(E^(((-1)/( 2)) Sin[3 x]))

Plot[{f[x],g},{x,-1,2},PlotStyle-> {Directive[Red,Thickness[.005]],Directive[Blue,Thickness[.01]]}]

ParametricPlot[{Sin[2 t],Sin[3 t]},{t,0,2π},PlotStyle-> Directive[Blue,Thick]]

ParametricPlot[{{Sin[2 t],Sin[3 t]},{Sin[t],Cos[t]}},{t,0,2π},PlotStyle->{Directive[Blue,Thick],Directive[Red,Thick]}]

ContourPlot[{(x^2)+(y^2)==1,(x^4)+(y^4)==1},{x,-1,1},{y,-1,1},ContourStyle->{Directive[Red,Thick],Directive[Blue,Thick]}]

ContourPlot[{((((x-5))^2)/49)+((((y-10))^2)/144)==1,((((x-5))^2)/49)-((((y-10))^2)/144)==1},{x,-10,25},{y,-10,25},ContourStyle-> {Directive[Red,Thick],Directive[Blue,Thick]}]

Animate[Plot[Sin[x],{x,0,A},PlotRange->{{0,4π},{-1.01,1.01}},PlotStyle->Directive[Blue,Thick]],{A,0.01,4π},AnimationRunning-> False]

Animate[{Plot[Sin[x],{x,0,A},PlotRange->{{0,4π},{-1,1}},PlotStyle->Directive[Blue,Thick]],Plot[Sin[x+A],{x,0,4π},PlotStyle->Directive[Red,Thick]]},{A,0.01,4π},AnimationRunning->False]

ellipses=(( (((x-10 Sin[A]))^2))/4.)+ (( (((y-10 Cos[A]))^2))/25.)==1;

Animate[ContourPlot[Evaluate[ellipses/.A->B],{x,-15,15},{y,-15,15},ContourStyle->Directive[Blue,Thick],PlotPoints->100,Epilog->{Red,Thick,Circle[{0,0},10]}],{B,0,2π},AnimationRate->.15,AnimationRunning-> False]

f[x_,y_]=Sin[x+y] Cos[x-y]+3;

g = Sin[x y] + (E^(-((x^2)+(y^2))));

Plot3D[{f[x,y],g},{x,-3,3},{y,-2,2},PlotStyle->{Red,Blue},AxesLabel->Automatic]

ParametricPlot3D[{Cos[2 t],Sin[4 t],Cos[6 t]},{t,0,2π},PlotStyle->Directive[Blue,Thick],PlotPoints->250,AxesLabel->Automatic]

ParametricPlot3D[{(E^(t/100)) Cos[t],(E^(t/100)) Sin[t],(t/10)},{t,0,48π},PlotStyle->Directive[Blue,Thick],PlotPoints->250]

ParametricPlot3D[{(7+3 Sin[u]) Sin[v],(7+3 Sin[u]) Cos[v],2 Cos[u]},{u,0,2π},{v,0,2π},PlotStyle->Blue]

ParametricPlot3D[{{(7+3 Sin[u]) Sin[v],(7+3 Sin[u]) Cos[v],2 Cos[u]},{2 Cos[u],(7+3 Sin[u]) Sin[v],(7+3 Sin[u]) Cos[v]},{(7+3 Sin[u]) Sin[v],2 Cos[u],(7+3 Sin[u]) Cos[v]}},{u,0,2π},{v,0,2π},PlotStyle->{Blue,Red,Green}]

ContourPlot3D[(x^2)+(z^2)==9,{x,-3,3},{y,-3,3},{z,-5,5},ContourStyle->Blue,BoxRatios->Automatic,AxesLabel->Automatic]

ContourPlot3D[{(x^2)+(y^2)+(z^2)==16,(x^2)+(y^2)==9},{x,-5,5},{y,-5,5},{z,-7,7},ContourStyle->{Blue,Red},BoxRatios->Automatic,AxesLabel->Automatic,Mesh->None]

Animate[ParametricPlot3D[{(C+A Sin[u]) Sin[v],(C+A Sin[u]) Cos[v],B Cos[u]},{u,0,2π},{v,0,2π},PlotStyle->Blue,AxesLabel->{x,y,z},PlotRange->{{-11,11},{-11,11},{-5,5}},PlotPoints->100,Mesh->None],{A,1,3},{B,1,4},{C,5,8},AnimationRunning->False,ControlType->Slider,ControlPlacement-> Right]