(* XeF4 computation; coordinates and radii from XeF4_F2.exe 04.01.2012 *)

t={{0.00000,0.00000,0.00000,0.68357},{0.00000,0.00000,1.84913,1.16556},{0.00000,0.00000,-1.84913,1.16556},{0.00000,0.00000,1.84913,0.0},{2.12880,0.00000,0.00000,1.44522},{3.72553,0.00000,0.00000,0.15151},{3.89033,-0.91738,0.00000,0.78055},{3.89033,0.45869,-0.79447,0.78055},{3.89033,0.45869,0.79447,0.78055},{-2.12880,0.00000,0.00000,1.44522},{-3.72553,0.00000,0.00000,0.15151},{-3.89033,-0.91738,0.00000,0.78055},{-3.89033,0.45869,-0.79447,0.78055},{-3.89033,0.45869,0.79447,0.78055},{0.00000,2.12880,0.00000,1.44522},{0.00000,3.72553,0.00000,0.15151},{-0.91738,3.89033,0.00000,0.78055},{0.45869,3.89033,-0.79447,0.78055},{0.45869,3.89033,0.79447,0.78055},{0.00000,-2.12880,0.00000,1.44522},{0.00000,-3.72553,0.00000,0.15151},{-0.91738,-3.89033,0.00000,0.78055},{0.45869,-3.89033,-0.79447,0.78055},{0.45869,-3.89033,0.79447,0.78055}};;

x=Table[t[[i,1]],{i,1,24}];
y=Table[t[[i,2]],{i,1,24}];
z=Table[t[[i,3]],{i,1,24}];
r=Table[t[[i,4]],{i,1,24}];

(* projection into xy plane *)
plot2=Table[Graphics[{Circle[{x[[i]],y[[i]]},r[[i]]]}],
{i,1,24}];
plot2a=Graphics[{Disk[{x[[6]],0},0.08], Disk[{x[[11]],0},0.08], Disk[{0,y[[16]]},0.08], Disk[{0,y[[21]]},0.08], Disk[{0,0},0.08],{Thickness[0.006],Line[{{x[[11]],0},{x[[6]],0}}],Line[{{0,y[[21]]},{0,y[[16]]}}] }} ];
Show[plot2,plot2a,{AspectRatio -> Automatic,Axes -> True,GridLines -> Automatic, PlotRange -> {{-4.75,4.75},{-4.75,4.75}}, Frame -> True}]

(* electron domains *)
plot2b=Table[Graphics3D[{Sphere[{x[[i]],y[[i]],z[[i]]},r[[i]]]}],
{i,1,24}];
Show[plot2b,{AspectRatio -> Automatic,SphericalRegion->True}]

(* projection into xz plane *)
plot3=Table[Graphics[{Circle[{x[[i]],z[[i]]},r[[i]]]}],{i,1,24}]; plot3a=Graphics[{Disk[{x[[6]],0},0.08], Disk[{x[[11]],0},0.08], Disk[{0,0},0.08],{Thickness[0.006],Line[{{x[[11]],0},{x[[6]],0}}] }}];
Show[plot3,plot3a,{AspectRatio -> Automatic,Axes -> True,GridLines -> Automatic, PlotRange -> {{-4.75,4.75},{-3.5,3.5}}, Frame -> True}]

(* Make stereo pair *)
t1=Table[{t[[i,1]],t[[i,2]],t[[i,3]]},{i,1,24}];
t=t1.RotationMatrix[-π/3,{1,0,0}];
t1=t;
t=t1.RotationMatrix[π/8,{0,0,1}];
plot4=Table[Graphics[{Circle[{t[[i,1]],t[[i,2]]},r[[i]]]}],{i,1,24}];
plot5=Graphics[{Disk[{t[[6,1]],t[[6,2]]},0.08], Disk[{t[[11,1]],t[[11,2]]},0.08],Disk[{t[[16,1]],t[[16,2]]},0.08],Disk[{t[[21,1]],t[[21,2]]},0.08], Disk[{0,0},0.1],{Thickness[0.006],Line[{{t[[11,1]],t[[11,2]]},{t[[6,1]],t[[6,2]]}}] ,Line[{{t[[21,1]],t[[21,2]]},{t[[16,1]],t[[16,2]]}}] }}];

t1=t;
t=t1.RotationMatrix[π/20,{1,1,0}];
plot4a=Table[Graphics[{Circle[{t[[i,1]],t[[i,2]]},r[[i]]]}],{i,1,24}];
plot5a=Graphics[{Disk[{t[[6,1]],t[[6,2]]},0.08], Disk[{t[[11,1]],t[[11,2]]},0.08],Disk[{t[[16,1]],t[[16,2]]},0.08],Disk[{t[[21,1]],t[[21,2]]},0.08], Disk[{0,0},0.1],{Thickness[0.006],Line[{{t[[11,1]],t[[11,2]]},{t[[6,1]],t[[6,2]]}}] ,Line[{{t[[21,1]],t[[21,2]]},{t[[16,1]],t[[16,2]]}}] }}];

Plota=Table[{0},{i,1,2}]; Plotb=Plota;
Plota[[1]]=plot4;
Plota[[2]]=plot4a;
Plotb[[1]]=plot5;
Plotb[[2]]=plot5a;
Table[Show[Plota[[i]],Plotb[[i]],{AspectRatio -> Automatic, ImageSize->{300,300}}],{i,1,2}]