import java.applet.Applet; import java.awt.*; import java.awt.event.*; import java.applet.*; import java.awt.geom.*; import java.math.*; import java.io.*; /**This class extracts the face list from a long polyhedron that is give in terms of vertices**/ public class LongPolyCombinatorics { /**This routine returns true if and only if the point lies in the (closed) polyhedron*/ public static boolean inside(LongVector W,LongPolyhedron P) { for(int i=0;i=target)&&(test>=target)) return(true); if((m[1]<=target)&&(test<=target)) return(true); return(false); } /*This routine returns true if a point lines strictly on the same side of a given face as a polyhedron.*/ public static boolean correctSideStrict(LongVector W,LongPolyhedron P,int f) { LongVector[] LIST=P.face(f); LongVector X=LongVector.normal(LIST); long target=LongVector.dot(X,LIST[0]); long test=LongVector.dot(X,W); long[] m=range(X,P); if((m[0]>=target)&&(test>target)) return(true); if((m[1]<=target)&&(test= max Q.V[i].W */ public static boolean separate(int q,LongPolyhedron P,LongPolyhedron Q) { for(long i=-q;i<=q;++i) { for(long j=-q;j<=q;++j) { for(long k=-q;k<=q;++k) { LongVector W=new LongVector(i,j,k); if(separates(W,P,Q)==true) return(true); }}} return(false); } /**This returns true if the vector W is such that min P.V[i].W >= max Q.V[i].W */ public static boolean separates(LongVector W,LongPolyhedron P,LongPolyhedron Q) { long z=LongVector.dot(W,W); if(z==0) return(false); long max=-10000000000L; long min=+10000000000L; for(int i=0;itest) min=test; } for(int i=0;itest) min=test; } for(int i=0;i