import java.applet.Applet; import java.awt.event.*; import java.awt.*; /**This class specifies some basic kinds of point configurations. It is not used in the proof.*/ public class Configuration { /**This is the preferred normalization of the triangular bipyramid*/ public static Complex[] configuration1() { Complex[] W=new Complex[4]; W[0]=new Complex(1,0); W[1]=new Complex(-.5,-Math.sqrt(3.0)/2.0); W[2]=new Complex(0,0); W[3]=new Complex(-.5,Math.sqrt(3.0)/2.0); return(W); } /**This is the other normalization of the triangular bipyramid*/ public static Complex[] configuration2() { Complex[] W=new Complex[4]; W[0]=new Complex(1,0); W[1]=new Complex(0,-Math.sqrt(1.0/3.0)); W[2]=new Complex(-1,0); W[3]=new Complex(0,Math.sqrt(1.0/3.0)); return(W); } /*This is the initial pyramid with-square-base*/ public static Complex[] configuration3() { Complex[] W=new Complex[4]; W[0]=new Complex(1,0); W[1]=new Complex(0,1); W[2]=new Complex(-1,0); W[3]=new Complex(0,-1); return(W); } /**random configuration**/ public static Complex[] randomPoints() { Complex[] Z=new Complex[4]; for(int i=0;i<4;++i) { double x=Math.random(); double y=Math.random(); double xx=x*(-2)+(1-x)*2; double yy=y*(-2)+(1-y)*2; Z[i]=new Complex(xx,yy); } Z[0]=new Complex(1+Math.random(),0); return(Z); } /**Stereo-Inverted Configuration**/ public static Complex[] stereoInverted(Complex[] Z) { Vector[] V=new Vector[5]; for(int i=0;i<4;++i) { V[i]=Stereo.inverseStereo(Z[i]); } V[4]=new Vector(0,0,1); Vector[] W=new Vector[5]; for(int i=0;i<5;++i) W[i]=XtraVector.swap(V[0],V[4],V[i]); W[0]=new Vector(W[4].x[0],W[4].x[1],W[4].x[2]); Complex[] ZZ=new Complex[4]; for(int i=0;i<4;++i) ZZ[i]=Stereo.stereo(W[i]); return(ZZ); } /**dyadic configuration**/ public static Complex[] dyadic(Complex[] Z,int[] size) { Complex[] W=new Complex[4]; Box B=new Box(); Complex zz=Complex.plus(Z[0],new Complex(.0000001,0)); B=XtraBox.dyadic1(zz,size[0]); W[0]=new Complex(B.z); W[0].y=0; for(int i=1;i<4;++i) { B=XtraBox.dyadic0(Z[i],size[i]); W[i]=new Complex(B.z); } return(W); } /**The color scheme**/ public static Color[] colors() { Color[] C={new Color(255,255,0),new Color(255,0,255),new Color(200,0,0),new Color(240,130,0)}; return(C); } }