This directory has the Mathematica code for my paper,
the Farthest Point Map on the Regular Dodecahedron.
Here are the files:

dodeca_posdom.m:
This has the positive dominance test

dodeca_code.m:
This has the formulas for the decagon vertices and the triple points
of the Voronoi decomposition.

dodeca_triangle.m:
This has the formulas for the triangle maps used in the paper.
These are the algebraic maps from the unit square to various triangles

dodeca1.m:
This generates the 360 polynomials which we test in
Chapter 5 of the paper.   These polynomials are
also pre-computed and stored in the files dodeca_storage163.m etc.

dodeca2.m:
This does the tests for Chapter 6 of the paper

dodeca3.m:
This generates the polynomials for Chapter 7 of the paper.
These polynomials are also pre-computed and stored
in the file dodeca_stored.m

dodeca_stored1.m:
This has the stored functions for Chapter 5.
These are the 360 polynomials generated by dodeca1.m
The objects F163,F168,F831,F834,F836,F839 each have 60 polynomials.
F163 has the 60 polynomials associated to City 163.  Etc.

dodeca_stored2.m:
This has the stored functions for Chapter 6.
These are generated by the file dodeca2.m
The objects COMPAREX, CONFINEX,STABLEX
have the functions.
COMPAREX has the functions pertaining to the edges e16 and e38
STABLEX has the functions pertaining to the stability if the other edges of the Voronoi decomposition
CONFINEX has the functions pertaining to the confinement of the vertices to the triangle Delta

dodeca_stored3.m:
This has the functions for chapter 7 of the paper.
These are generated by the file dodeca3.m.
These are the functions which describe the city
boundaries.  The functions are g1638, g8346, etc.
In this file we also store the other factors 
associated to these polynomials. Thus, for instance,
the file dodeca3.m will generate the function f1638,
and then you can verify that g1638 is a factor of
f1368 by checking that f1638 = g1638 h1638




Sample calculations:

Here is one of the 360 calculations from chapter 5.
1. Open up Mathematica
2. Load in the files using the command <<dodeca_load.m
3. Run the command Clear[x,y];f=City163[1,x,y];
This produces the first of the polynomials.  We call it f.
4. Check that f equals F163[[1]].
5. Do the commands:  x=a;y=b;PosdomTest[f];
This is running the positive dominant test for f.
6. Do the command: ContourPlot[f,{x,0,1},{y,0,1}].
This will show f to be everywhere positive.

Here is another of these 360 calculations:
1-5: repeat steps 1-5 from the last calculation 
except that you should test City834[5,x,y]
You will notice that the posdom test returns -1
which means that the new f fails the test.
So, instead run these lines:
x=a/2;y=b;PosdomTest[f];
x=1-a/2;y=b;PosdomTest[f];

You can of course test all these
polynomials at the same time.  For 
instance, the function F163 contains
all the 60 polynomials associated to
City163.  So you could run the commands
x=a/2;y=b;Table[PosdomTest[F163[[j]]],{j,1,60}]
x=1-a/2;y=b;Table[PosdomTest[F163[[j]]],{j,1,60}]
and you will get output which is an array of 0s and 1s.
As long as there are no (-1)s all the functions are
positive dominant. 

When you do such calculations for F163,F168,F831,F834,F836,F839
you have finished the tests for Chapter 5 of the paper.  This is
all you have to do with the file dodeca1.m

The file dodeca2.m has the tests for Chapter 6.  The polynomials
are organized into three lists:
COMPAREList[]  (testing the edge e16 and e83 in the paper)
STABLEList[]   (testing the stability of the other edges in the Voronoi decomposition)
CONFINEList[]  (testing that the vertices are in the triangle delta)
If you enter one of the commands above, you get a list of polynomials.
These polynomials are also stored as 
COMPAREX
STABLEX
CONFINEX
in the file dodeca_stored2.m.
You can run the posdom tests for these functions as in the paper.

the file dodeca3.m has the files for Chapter 7. You can
plot these functions, take their gradients, etc.  For these
files I have not explicitly composed the functions with
the triangle maps, but you can use them to test the positive
dominance.  A typical command would be
{x,y}=P2g1[a,b];PosdomTest[f].
This makes the substitution using the triangle map to the triangle Upsilon1
and then runs the posdom test.  Sometimes you need something fancier, like
{x,y}=P2g1[a/2,1-b/2];PosdomTest[f] 
This tests a subdivision of the function.














                    
		
