SetDirectory["C:\\Users\\McQuarrie\\Documents\\Teaching\\Math 1014 Precalculus (online)\\Resources"]

f[x_]=Piecewise[{{Sin[x],x<0},{x,x>0}}];

Horizontal Translation f(x) and f(x+a)

Manipulate[Plot[{f[x],f[x+a]},{x,-10,10},PlotRange->{{-10,10},{-10,10}},AspectRatio->1,PlotStyle->{{Dashed,Thick},{Thick}},AxesLabel->{"x","y"},BaseStyle->{FontFamily->"Times",FontSize->24}],{a,0,5,0.1}]

list1=Table[Plot[{f[x],f[x+a]},{x,-10,10},PlotRange->{{-10,10},{-10,10}},AspectRatio->1,PlotStyle->{{Dashed,Thick},{Thick}},AxesLabel->{"x","y"},BaseStyle->{FontFamily->"Times",FontSize->24}],{a,0,5,0.1}];

Export["horiztransl.gif",list1]

Vertical Translation f(x) and f(x)+a

Manipulate[Plot[{f[x],f[x]+a},{x,-10,10},PlotRange->{{-10,10},{-10,10}},AspectRatio->1,PlotStyle->{{Dashed,Thick},{Thick}},AxesLabel->{"x","y"},BaseStyle->{FontFamily->"Times",FontSize->24}],{a,0,5,0.1}]

list2=Table[Plot[{f[x],f[x]+a},{x,-10,10},PlotRange->{{-10,10},{-10,10}},AspectRatio->1,PlotStyle->{{Dashed,Thick},{Thick}},AxesLabel->{"x","y"},BaseStyle->{FontFamily->"Times",FontSize->24}],{a,0,5,0.1}];

Export["verttransl.gif",list2]

Horizontal Compression f(x) and f(a*x), a>1

Manipulate[Plot[{f[x],f[a*x]},{x,-10,10},PlotRange->{{-10,10},{-10,10}},AspectRatio->1,PlotStyle->{{Dashed,Thick},{Thick}},AxesLabel->{"x","y"},BaseStyle->{FontFamily->"Times",FontSize->24}],{a,1,5,0.1}]

list3=Table[Plot[{f[x],f[a*x]},{x,-10,10},PlotRange->{{-10,10},{-10,10}},AspectRatio->1,PlotStyle->{{Dashed,Thick},{Thick}},AxesLabel->{"x","y"},BaseStyle->{FontFamily->"Times",FontSize->24}],{a,1,5,0.1}];

Export["horizcompression.gif",list3]

Horizontal Stretch f(x) and f(a*x), a<1

Manipulate[Plot[{f[x],f[a*x]},{x,-10,10},PlotRange->{{-10,10},{-10,10}},AspectRatio->1,PlotStyle->{{Dashed,Thick},{Thick}},AxesLabel->{"x","y"},BaseStyle->{FontFamily->"Times",FontSize->24}],{a,1,0,-0.02}]

list3a=Table[Plot[{f[x],f[a*x]},{x,-10,10},PlotRange->{{-10,10},{-10,10}},AspectRatio->1,PlotStyle->{{Dashed,Thick},{Thick}},AxesLabel->{"x","y"},BaseStyle->{FontFamily->"Times",FontSize->24}],{a,1,0,-0.02}];

Export["horizstretch.gif",list3a]

Vertical Stretch f(x) and a*f(x), a>1

Manipulate[Plot[{f[x],a*f[x]},{x,-10,10},PlotRange->{{-10,10},{-10,10}},AspectRatio->1,PlotStyle->{{Dashed,Thick},{Thick}},AxesLabel->{"x","y"},BaseStyle->{FontFamily->"Times",FontSize->24}],{a,1,5,0.1}]

list4=Table[Plot[{f[x],a*f[x]},{x,-10,10},PlotRange->{{-10,10},{-10,10}},AspectRatio->1,PlotStyle->{{Dashed,Thick},{Thick}},AxesLabel->{"x","y"},BaseStyle->{FontFamily->"Times",FontSize->24}],{a,1,5,0.1}];

Export["vertstretch.gif",list4]

Vertical Compression f(x) and a*f(x), a<1

Manipulate[Plot[{f[x],a*f[x]},{x,-10,10},PlotRange->{{-10,10},{-10,10}},AspectRatio->1,PlotStyle->{{Dashed,Thick},{Thick}},AxesLabel->{"x","y"},BaseStyle->{FontFamily->"Times",FontSize->24}],{a,1,0,-0.02}]

list4a=Table[Plot[{f[x],a*f[x]},{x,-10,10},PlotRange->{{-10,10},{-10,10}},AspectRatio->1,PlotStyle->{{Dashed,Thick},{Thick}},AxesLabel->{"x","y"},BaseStyle->{FontFamily->"Times",FontSize->24}],{a,1,0,-0.02}];

Export["vertcompression.gif",list4a]