Saturday, December 21, 2019

Lists & Arrays as PlayGrounds


A=Array[1+Sin[#1Pi/4]^2+Cos[#2Pi/6]^4 &,{4,6}]
ArrayPlot[A,ColorFunction->"DeepSeaColors",ImageSize->Small]
X={{.10,.05,.95},{.09,.03,.08},{.01,.09,.91},{.04,.92,.07},{.05,.02,.04},
      { .07,.97,.05},{.06,.02,.98},{.02,.06,.03},{.01,.09,.03},{.02,.94,.01}};
X[[1;;5]]    
ArrayPlot[Transpose[X],ColorFunction->"BrightBands",ImageSize->Small]
Y=Transpose[{{1,0,1,2,0,2,1,0,1,2}}]
ArrayPlot[Transpose[Y],ColorFunction->"Rainbow",ImageSize->Small]


Surfaces' Translation


cp1=ContourPlot3D[z==x^4+y^3-1,
{x,-2,2},{y,-2,2},{z,-1,1},
ContourStyle->{Blue,Opacity[0.2]},
Mesh->20,MeshStyle->{Darker[Blue],Blue},
MeshFunctions->{Sin[2#1*#3]&,Cos[3#2*#3]&}];
cp2=Graphics3D[{Opacity[.5],EdgeForm[Darker[Blue]],
Translate[Icosahedron[0.3],
Table[{x,(1-x^4)^(1/3),0},{x,Range[-1,1,0.5]}]]}];
Show[cp1,cp2,PlotRange->All,Axes->False,
Boxed->False,PlotLabel->"Surfaces' Translation"]


Surfaces' Coordinates


Plot3D[Table[(x^2-y^2)^4 *z^2,{z,9,49,10}] // Evaluate,
{x,-.5,.5},{y,-.5,.5}, PlotStyle->Opacity[.3],
ColorFunction->"BrightBands",Mesh->False,
ClippingStyle->None,Boxed->False,
Axes->False,PlotLabel->"Surfaces' Coordinates"]


Surfaces' Intersection


h=x^4+y^4+z-3; g=x^3+y^2-z^3;
ContourPlot3D[{h==0,g==0},
{x,-2,2},{y,-2,2}, {z,-2,2},
MeshFunctions->{Function[{x,y,z,f},h-g]},
MeshStyle->{{Thick,Blue}}, Mesh->{{0}},
ContourStyle ->Opacity[0.5],ImageSize->Medium,
ColorFunction->"DeepSeaColors",
Boxed->False,Axes->False,
PlotLabel->"Surfaces' Intersection"]

Matrix Forms as PlayGrounds


Manipulate[Style[MatrixForm[Array[Subscript[\[Alpha],##] &,
{N,N}]],{Medium,Bold,c}],
{N,Range[2,5,1]},{c,{Darker[Gray],Blue,Orange}}]
MatrixForm[Partition[Map[{{Subscript[#,11],
Subscript[#,12]},{Subscript[#,21],
Subscript[#,22]}}&,{A,B,C,D}],2]]
m=RandomInteger[{0,127},{4,5}]; mf=MatrixForm[m];
MatrixPlot[m,ColorFunction->"DeepSeaColors",
ImageSize->Small]
ScientificForm[MatrixForm[m/10.^5]]
{mf->BaseForm[mf,2]->PaddedForm[BaseForm[mf,2],
8,NumberPadding -> {"0", ""}]}