import java.applet.Applet; import java.awt.event.*; import java.awt.*; import java.awt.geom.*; /**This class does the basic iterations associated to the outer billiards map**/ public class OuterBilliards { /**This routine finds the vertex such that rotation about this vertex does the outer billiards map.**/ public static int findGoodVertex(Complex w) { PolyWedge Q=PolyWedge.penroseKite(); int index=0; for(int i=0;i<4;++i) { boolean test=Complex.isPositivelyOriented(w,Q.z[index],Q.z[i]); if(test==true) { index=i; } } return(index); } /**This does one step of the outer billiards map**/ public static Complex nextComplex(Complex z) { PolyWedge Q=PolyWedge.penroseKite(); int k=findGoodVertex(z); Complex Z=new Complex(Q.z[k]); Z=Complex.plus(Z,Z); Z=Complex.minus(Z,z); Z.history=k; return(Z); } /**This does the outer billiards map for a polygon. We use the center point to define the map. Hence, this construction is only valid for a polygon that is contained in an orbit tile.*/ public static PolyWedge nextPoly(PolyWedge P) { PolyWedge Q=PolyWedge.penroseKite(); int k=findGoodVertex(P.getCenter()); Complex Z=new Complex(Q.z[k]); Z=Complex.plus(Z,Z); PolyWedge PP=new PolyWedge(); for(int i=0;i