(***********************************************************************
This file was generated automatically by the Mathematica front end.
It contains Initialization cells from a Notebook file, which typically
will have the same name as this file except ending in ".nb" instead of
".m".

This file is intended to be loaded into the Mathematica kernel using
the package loading commands Get or Needs.  Doing so is equivalent to
using the Evaluate Initialiation Cells menu command in the front end.

DO NOT EDIT THIS FILE.  This entire file is regenerated automatically 
each time the parent Notebook file is saved in the Mathematica front end.
Any changes you make to this file will be overwritten.
***********************************************************************)













\!\(Triangle /: Vertices[Triangle] := 
    N[{{1, 0}, {Re[Exp[\(2\ \[Pi]\ I\)\/3]], Im[Exp[\(2\ \[Pi]\ I\)\/3]]}, {
          Re[Exp[\(4\ \[Pi]\ I\)\/3]], Im[Exp[\(4\ \[Pi]\ I\)\/3]]}}]\)

Triangle/:Edges[Triangle]:={{1,2},{2,3},{1,3}}

\!\(DualVertices[polygon_] := 
    Module[{vertices, edges}, vertices = Vertices[polygon]; 
      edges = Edges[polygon]; 
      1\/2\ Apply[Plus, 
          \((vertices\[LeftDoubleBracket]#1\[RightDoubleBracket]&)\)/@edges, 
          1]]\)





\!\(Norm[vector_] := \@Plus@@\(\((#1\^2&)\)/@vector\)\)

DualTriangle/:Vertices[DualTriangle]:=2 DualVertices[Triangle]
DualTriangle/:Edges[DualTriangle]=Edges[Triangle];

complexToCartesian[z_]:={Re[z],Im[z]}

\!\(Pentagon /: Vertices[Pentagon] := 
    complexToCartesian/@Table[N[Exp[\(2\ \[Pi]\ I\ k\)\/5]], {k, 0, 4}]\n
  DualPentagon /: Vertices[DualPentagon] := 
    complexToCartesian/@
      Table[N[Exp[\[Pi]\ I + \(2\ \[Pi]\ I\ k\)\/5]], {k, 0, 4}]\n
  \(Pentagon /: Edges[Pentagon] = {{1, 2}, {2, 3}, {3, 4}, {4, 5}, {5, 1}}; 
  \)\n
  \(DualPentagon /: Edges[DualPentagon] = Edges[Pentagon]; \)\)

Square/:Vertices[Square]:={{1,1},{-1,1},{-1,-1},{1,-1}}
Square/:Edges[Square]:={{1,2},{2,3},{3,4},{4,1}}

skeleton2D[polygon_,edgecolor_,vertexcolor_]:=
  skeleton2D[polygon,edgecolor,vertexcolor,{0,0},1.]
skeleton2D[polygon_,edgecolor_,vertexcolor_,translation_,scale_]:=
  Module[{vertices,edges,lines,points},
    vertices=(translation+#1&)/@(scale Vertices[polygon]);
    edges=Edges[polygon];
    lines=Line/@(vertices\[LeftDoubleBracket]#1\[RightDoubleBracket]&)/@edges;
    points=Point/@vertices;
    Graphics[{{Thickness[.005],edgecolor,lines},{PointSize[.01],vertexcolor,
          points}}]]

\!\(tab[a_, b_] := 
    Module[{alpha, v0, v1}, alpha = 1\/10; 
      v0 = 1\/10\ 
          \((\((b - a)\)\[LeftDoubleBracket]1\[RightDoubleBracket] + 
              I\ \((b - a)\)\[LeftDoubleBracket]2\[RightDoubleBracket])\)\ 
          Exp[\(-\(\(\[Pi]\ I\)\/4\)\)]; v0 = {Re[v0], Im[v0]}; 
      v1 = 1\/10\ 
          \((\((b - a)\)\[LeftDoubleBracket]1\[RightDoubleBracket] + 
              I\ \((b - a)\)\[LeftDoubleBracket]2\[RightDoubleBracket])\)\ 
          Exp[\(\[Pi]\ I\)\/4]; v1 = {Re[v1], Im[v1]}; 
      Graphics[{grey, 
          Polygon[{\((1 - alpha)\)\ a + alpha\ b, 
              \((1 - alpha)\)\ a + alpha\ b + v0, 
              \((1 - alpha)\)\ b + alpha\ a - v1, 
              \((1 - alpha)\)\ b + alpha\ a}]}]]\n
  dualtab[a_, b_] := 
    Module[{alpha, v0, v1}, alpha = 1\/10; 
      v0 = 1\/10\ 
          \((\((b - a)\)\[LeftDoubleBracket]1\[RightDoubleBracket] + 
              I\ \((b - a)\)\[LeftDoubleBracket]2\[RightDoubleBracket])\)\ 
          Exp[\(\[Pi]\ I\)\/4]; v0 = {Re[v0], Im[v0]}; 
      v1 = 1\/10\ 
          \((\((b - a)\)\[LeftDoubleBracket]1\[RightDoubleBracket] + 
              I\ \((b - a)\)\[LeftDoubleBracket]2\[RightDoubleBracket])\)\ 
          Exp[\(-\(\(\[Pi]\ I\)\/4\)\)]; v1 = {Re[v1], Im[v1]}; 
      Graphics[{grey, 
          Polygon[{\((1 - alpha)\)\ a + alpha\ b, 
              \((1 - alpha)\)\ a + alpha\ b + v0, 
              \((1 - alpha)\)\ b + alpha\ a - v1, 
              \((1 - alpha)\)\ b + alpha\ a}]}]]\)



red=RGBColor[.8,0,0];
blue=RGBColor[0,0,.8];
black=RGBColor[0,0,0];
green=RGBColor[0,.5,.2];
grey=RGBColor[.6,.6,.6];

tetrahedron[]:=
  Module[{basicvectors},basicvectors=2 DualVertices[Triangle];
    Show[{tab[
          basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket]+
            Vertices[DualTriangle]\[LeftDoubleBracket]1\[RightDoubleBracket],
          basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket]+
            Vertices[DualTriangle]\[LeftDoubleBracket]2\[RightDoubleBracket]],
        tab[basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket]+
            Vertices[DualTriangle]\[LeftDoubleBracket]3\[RightDoubleBracket],
          basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket]+
            Vertices[DualTriangle]\[LeftDoubleBracket]1\[RightDoubleBracket]],
        tab[basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket]+
            Vertices[DualTriangle]\[LeftDoubleBracket]2\[RightDoubleBracket],
          basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket]+
            Vertices[DualTriangle]\[LeftDoubleBracket]3\[RightDoubleBracket]],
        skeleton2D[Triangle,red,red,{0,0},1],
        skeleton2D[DualTriangle,red,red,
          basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket],1],
        skeleton2D[DualTriangle,red,red,
          basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket],1],
        skeleton2D[DualTriangle,red,red,
          basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket],1]},
      AspectRatio\[Rule]Automatic]]

cube[]:=Module[{basicvectors},basicvectors=2 DualVertices[Square];
    Show[{Table[
          tab[basicvectors\[LeftDoubleBracket]i\[RightDoubleBracket]+
              Vertices[Square]\[LeftDoubleBracket]Mod[i-1+j,4]+1
                  \[RightDoubleBracket],
            basicvectors\[LeftDoubleBracket]i\[RightDoubleBracket]+
              Vertices[Square]\[LeftDoubleBracket]Mod[i+j,4]+1
                  \[RightDoubleBracket]],{i,2,4},{j,0,1}],
        tab[basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket]+
            Vertices[Square]\[LeftDoubleBracket]1\[RightDoubleBracket],
          basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket]+
            Vertices[Square]\[LeftDoubleBracket]2\[RightDoubleBracket]],
        skeleton2D[Square,red,red,{0,0},1],
        Table[skeleton2D[Square,red,red,
            basicvectors\[LeftDoubleBracket]i\[RightDoubleBracket],1],{i,1,
            4}],skeleton2D[Square,red,red,
          2 basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket],1]},
      AspectRatio\[Rule]Automatic]]

octahedron[]:=
  Module[{basicvectors},basicvectors=2 DualVertices[Triangle];
    Show[{tab[
          basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket]+
            Vertices[Triangle]\[LeftDoubleBracket]1\[RightDoubleBracket],
          basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket]+
            Vertices[Triangle]\[LeftDoubleBracket]2\[RightDoubleBracket]],
        tab[basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket]+
            Vertices[Triangle]\[LeftDoubleBracket]3\[RightDoubleBracket],
          basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket]+
            Vertices[Triangle]\[LeftDoubleBracket]1\[RightDoubleBracket]],
        tab[basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket]+
            Vertices[Triangle]\[LeftDoubleBracket]2\[RightDoubleBracket],
          basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket]+
            Vertices[Triangle]\[LeftDoubleBracket]3\[RightDoubleBracket]],
        tab[basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket]+
            Vertices[Triangle]\[LeftDoubleBracket]2\[RightDoubleBracket],
          basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket]+
            Vertices[Triangle]\[LeftDoubleBracket]3\[RightDoubleBracket]],
        tab[basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket]+
            Vertices[DualTriangle]\[LeftDoubleBracket]1\[RightDoubleBracket],
          basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket]+
            Vertices[DualTriangle]\[LeftDoubleBracket]2\[RightDoubleBracket]],
        skeleton2D[Triangle,red,red,{0,0},1],
        skeleton2D[DualTriangle,red,red,
          basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket],1],
        skeleton2D[DualTriangle,red,red,
          basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket],1],
        skeleton2D[DualTriangle,red,red,
          basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket],1],
        skeleton2D[Triangle,red,red,
          basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket],1],
        skeleton2D[Triangle,red,red,
          basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket],1],
        skeleton2D[Triangle,red,red,
          basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket],1],
        skeleton2D[DualTriangle,red,red,
          basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket]+
            basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket],1]},
      AspectRatio\[Rule]Automatic]]

icosahedron:=
  Module[{basicvectors},basicvectors=2 DualVertices[Triangle];
    Show[{tab[
          basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket]+
            Vertices[DualTriangle]\[LeftDoubleBracket]3\[RightDoubleBracket],
          basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket]+
            Vertices[DualTriangle]\[LeftDoubleBracket]1\[RightDoubleBracket]],
        tab[basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket]+
            Vertices[Triangle]\[LeftDoubleBracket]1\[RightDoubleBracket],
          basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket]+
            Vertices[Triangle]\[LeftDoubleBracket]2\[RightDoubleBracket]],
        tab[2 basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket]+
            Vertices[DualTriangle]\[LeftDoubleBracket]1\[RightDoubleBracket],
          2 basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket]+
            Vertices[DualTriangle]\[LeftDoubleBracket]2\[RightDoubleBracket]],
        tab[basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket]+
            Vertices[Triangle]\[LeftDoubleBracket]2\[RightDoubleBracket],
          basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket]+
            Vertices[Triangle]\[LeftDoubleBracket]3\[RightDoubleBracket]],
        tab[2 basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket]+
            Vertices[DualTriangle]\[LeftDoubleBracket]2\[RightDoubleBracket],
          2 basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket]+
            Vertices[DualTriangle]\[LeftDoubleBracket]3\[RightDoubleBracket]],
        tab[basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket]+
            Vertices[Triangle]\[LeftDoubleBracket]3\[RightDoubleBracket],
          basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket]+
            Vertices[Triangle]\[LeftDoubleBracket]1\[RightDoubleBracket]],
        skeleton2D[Triangle,red,red,{0,0},1],
        skeleton2D[DualTriangle,red,red,
          basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket],1],
        skeleton2D[DualTriangle,red,red,
          basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket],1],
        skeleton2D[Triangle,red,red,
          basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket],1],
        skeleton2D[Triangle,red,red,
          basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket],1],
        skeleton2D[Triangle,red,red,
          basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket],1],
        skeleton2D[Triangle,red,red,
          basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket],1],
        skeleton2D[DualTriangle,red,red,
          basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket]+
            basicvectors\[LeftDoubleBracket]1\[RightDoubleBracket],1],
        skeleton2D[DualTriangle,red,red,
          basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket]-
            basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket]+
            basicvectors\[LeftDoubleBracket]2\[RightDoubleBracket],1],
        skeleton2D[DualTriangle,red,red,
          basicvectors\[LeftDoubleBracket]3\[RightDoubleBracket],1]},
      AspectRatio\[Rule]Automatic]]



dodecahedron:=
  Module[{basicvectors},basicvectors=2 DualVertices[Pentagon];
    Show[{skeleton2D[Pentagon,red,red,{0,0},1],
        Table[{tab[
              basicvectors\[LeftDoubleBracket]i\[RightDoubleBracket]+
                Vertices[DualPentagon]\[LeftDoubleBracket]Mod[i,5]+1
                    \[RightDoubleBracket],
              basicvectors\[LeftDoubleBracket]i\[RightDoubleBracket]+
                Vertices[DualPentagon]\[LeftDoubleBracket]Mod[i+1,5]+1
                    \[RightDoubleBracket]],
            tab[basicvectors\[LeftDoubleBracket]i\[RightDoubleBracket]+
                Vertices[DualPentagon]\[LeftDoubleBracket]Mod[i+1,5]+1
                    \[RightDoubleBracket],
              basicvectors\[LeftDoubleBracket]i\[RightDoubleBracket]+
                Vertices[DualPentagon]\[LeftDoubleBracket]Mod[i+2,5]+1
                    \[RightDoubleBracket]],
            skeleton2D[DualPentagon,red,red,
              basicvectors\[LeftDoubleBracket]i\[RightDoubleBracket],1]},{i,1,
            5}]},AspectRatio\[Rule]Automatic]]

\!\(revdodecahedron := 
    Module[{basicvectors, Pentagon, DualPentagon, tab}, 
      Pentagon /: Vertices[Pentagon] := 
        complexToCartesian/@
          Table[N[Exp[\(-\(2\/5\)\)\ \[Pi]\ I\ k]], {k, 0, 4}]; 
      DualPentagon /: Vertices[DualPentagon] := 
        complexToCartesian/@
          Table[N[Exp[\[Pi]\ I - \(2\ \[Pi]\ I\ k\)\/5]], {k, 0, 4}]; 
      Pentagon /: Edges[Pentagon] = {{1, 2}, {2, 3}, {3, 4}, {4, 5}, {5, 1}}; 
      DualPentagon /: Edges[DualPentagon] = Edges[Pentagon]; 
      tab[a_, b_] := 
        Module[{alpha, v0, v1}, alpha = 1\/10; 
          v0 = 1\/10\ 
              \((\((b - a)\)\[LeftDoubleBracket]1\[RightDoubleBracket] + 
                  I\ \((b - a)\)\[LeftDoubleBracket]2\[RightDoubleBracket])
                \)\ Exp[\(\[Pi]\ I\)\/4]; v0 = {Re[v0], Im[v0]}; 
          v1 = 1\/10\ 
              \((\((b - a)\)\[LeftDoubleBracket]1\[RightDoubleBracket] + 
                  I\ \((b - a)\)\[LeftDoubleBracket]2\[RightDoubleBracket])
                \)\ Exp[\(-\(\(\[Pi]\ I\)\/4\)\)]; v1 = {Re[v1], Im[v1]}; 
          Graphics[{grey, 
              Polygon[{\((1 - alpha)\)\ a + alpha\ b, 
                  \((1 - alpha)\)\ a + alpha\ b + v0, 
                  \((1 - alpha)\)\ b + alpha\ a - v1, 
                  \((1 - alpha)\)\ b + alpha\ a}]}]]; 
      basicvectors = 2\ DualVertices[Pentagon]; 
      Show[{skeleton2D[Pentagon, red, red, {0, 0}, 1], 
          Table[{tab[
                basicvectors\[LeftDoubleBracket]i\[RightDoubleBracket] + 
                  \(Vertices[DualPentagon]\)\[LeftDoubleBracket]Mod[i, 5] + 1
                      \[RightDoubleBracket], 
                basicvectors\[LeftDoubleBracket]i\[RightDoubleBracket] + 
                  \(Vertices[DualPentagon]
                      \)\[LeftDoubleBracket]Mod[i + 1, 5] + 1
                      \[RightDoubleBracket]], 
              tab[basicvectors\[LeftDoubleBracket]i\[RightDoubleBracket] + 
                  \(Vertices[DualPentagon]
                      \)\[LeftDoubleBracket]Mod[i + 1, 5] + 1
                      \[RightDoubleBracket], 
                basicvectors\[LeftDoubleBracket]i\[RightDoubleBracket] + 
                  \(Vertices[DualPentagon]
                      \)\[LeftDoubleBracket]Mod[i + 2, 5] + 1
                      \[RightDoubleBracket]], 
              skeleton2D[DualPentagon, red, red, 
                basicvectors\[LeftDoubleBracket]i\[RightDoubleBracket], 1]}, {
              i, 1, 5}]}, AspectRatio \[Rule] Automatic]]\)





























