import java.applet.Applet; import java.awt.event.*; import java.awt.*; public class IntervalEnergy { /**This is the basic routine. It computes the quantity 1/d^e, where d is the E3-distance between the vectors V1 and V2. **/ public static Interval interaction(double e,IntervalVector V1,IntervalVector V2) { Interval d=IntervalVector.dist(V1,V2); Interval ONE=new Interval(1.0); if(e<1.5) return(Interval.divide(ONE,d)); return(Interval.divide(ONE,Interval.times(d,d))); } /**This routine computes the total energy of 4 points in the plane, plus the point at infinity. These 4 points are mapped stereographically to the unit sphere, and the vector (0,0,1) is included as the image of infinity. */ public static Interval energy(double e,IntervalComplex[] z) { IntervalVector[] V=new IntervalVector[5]; for(int i=0;i<4;++i) V[i]=IntervalStereo.inverseStereo(z[i]); V[4]=IntervalVector.northPole(); Interval total=new Interval(0.0); for(int i=0;i<5;++i) { for(int j=i+1;j<5;++j) { total=Interval.plus(total,interaction(e,V[i],V[j])); } } return(total); } /**This is the energy lower bound based on the distance upper bound from the paper**/ public static Interval energyLowerBound(double e,IntervalBox B1,IntervalBox B2) { Interval dist=IntervalSeparation.psiMax(B1,B2); if(dist.l<=0.0) return(new Interval(10000000)); Interval ONE=new Interval(1.0); if(e>1.5) { Interval t=Interval.divide(ONE,Interval.times(dist,dist)); return(t); } Interval t=Interval.divide(ONE,dist); return(t); } /**These intervals give UPPER bounds to the minimum energy.**/ public static Interval minEnergy(double e) throws ProofException { if(e==1) return(new Interval(6.4746914946882)); if(e==2) return(Interval.fat(4.25)); throw new ProofException("IntervalEnergy: exponent not 1 or 2"); } /**This is used in the tetrahedral eliminator**/ public static Interval tetrahedralComplement(double e) throws ProofException { if(e==1) return(new Interval(2.800457)); if(e==2) return(Interval.fat(2.0)); throw new ProofException("IntervalEnergy: exponent not 1 or 2"); } }