import java.applet.Applet; import java.awt.*; import java.awt.event.*; import java.applet.*; import java.awt.geom.*; import java.math.*; /*This file gives an approximate computation of the volume of our polyhedra. When scaled, our polyhedra are all lattice polyhedra. The volume of the scaled polyhedra is (1/6) times an integer. This allows us to deduce the correct volume from the approximation computed here.*/ public class VolumeComputer { /*Prints out 6 times the 420-scaled volume. So, the actual volume is (this)/6/(420^3).*/ public static void main() { for(int i=0;i<51;++i) { LongPolyhedron P=DataPartition.poly(i); long v=volume6(0,P); System.out.print(v+","); } } /*In the case of triv1, one of the faces has more than 4 vertices. For this poly, we cone to a vertex on this face.*/ public static void extra() { LongPolyhedron P=DataPartitionExtra.triv1(); long v=volume6(4,P); System.out.println("trivial tile from 1/2 to 3/4: "+v); P=DataPartitionExtra.domainF1(); v=volume6(0,P); System.out.println("domain from 1/4 to 2: "+v); P=DataPartitionExtra.domainF3(); v=volume6(0,P); System.out.println("domain from 5/4 to 2: "+v); P=DataPartitionExtra.domainF4(); v=volume6(0,P); System.out.println("domain from 1/2 to 3/4: "+v); } /*Computes 6 times the volume, in case no face has more than 4 vertices.*/ public static long volume6(int q,LongPolyhedron P) { LongVector V=P.V[q]; long total=0; for(int i=0;i