gauss2d0[x_, y_, s11_, s12_, s22_] :=
-Log[
1/Sqrt[(2Pi)^2*(s11*s22-s12^2)]*Exp[-(s22*x^2-2*s12*x*y+s11*y^2)/(2*(s11*s22-s12^2))]
]

twistedgauss2d0[x_, y_, s11_, s12_, s22_, twist_]:=gauss2d0[x*Cos[twist*Norm[{x,y}]]-y*Sin[twist*Norm[{x,y}]],y*Cos[twist*Norm[{x,y}]]+x*Sin[twist*Norm[{x,y}]], s11, s12, s22]

s11 = 1.;
s12 = 1.2;
s22 = 2.;
twist = 0.;

untwisted = ContourPlot[-twistedgauss2d0[x,y,s11,s12,s22,twist],{x,-3,3},{y,-3,3},
Contours->10,ColorFunction->{ColorData["DeepSeaColors"]},
LabelStyle->{20,GrayLevel[0.5]}, FrameTicks->{{{-3,-2,-1,0,1,2,3},None},{{-3,-2,-1,0,1,2,3},None}}]

loglogUntwisted = ContourPlot[.8-.2Log[Log[twistedgauss2d0[x,y,s11, s12, s22, twist]]],
{x, -3,3}, {y, -3, 3}, MaxRecursion->3,Contours->10, ColorFunctionScaling->False,
LabelStyle->{20,GrayLevel[0.5]}, FrameTicks->{{{-3,-2,-1,0,1,2,3},None},{{-3,-2,-1,0,1,2,3},None}}]

twist = .5;
twisted = ContourPlot[-twistedgauss2d0[x,y,s11, s12, s22, twist],
{x, -3,3}, {y, -3, 3}, MaxRecursion->3,Contours->10, 
ColorFunction->{ColorData["DeepSeaColors"]},
LabelStyle->{20,GrayLevel[0.5]}, FrameTicks->{{{-3,-2,-1,0,1,2,3},None},{{-3,-2,-1,0,1,2,3},None}}]

loglogTwisted = ContourPlot[.8-.2Log[Log[twistedgauss2d0[x,y,s11, s12, s22, twist]]],
{x, -3,3}, {y, -3, 3}, MaxRecursion->3,Contours->10, ColorFunctionScaling->False,
LabelStyle->{20,GrayLevel[0.5]}, FrameTicks->{{{-3,-2,-1,0,1,2,3},None},{{-3,-2,-1,0,1,2,3},None}}]

SetDirectory[StringJoin[NotebookDirectory[], "images/function_explanation"]];
images = FileNames["*"];
DeleteFile[images]; 
Export["01_untwisted.gif",untwisted];
Export["02_loglogUntwisted.gif",loglogUntwisted];
Export["03_twisted.gif",twisted];
Export["04_loglogTwisted.gif",loglogTwisted];