public class shape_factor
{
public static double F_parallel_rectangles(double X,double Y, double L)
{// L distance between plates
 // X ,Y plate size
	double x=X/L;
 double y=Y/L;
 double x1=1+x*x;
 double x2=Math.sqrt(x1);
 double y1=1+y*y;
 double y2=Math.sqrt(y1);
 double Fij=2.0/(Math.PI*x*y)*(Math.log(Math.sqrt(x1*y1/(1+x*x+y*y)))+
 x*y2*Math.atan(x/y2)+
 y*x2*Math.atan(y/x2)-x*Math.atan(x)-y*Math.atan(y));
 return Fij;
}

public static double F_perpendicular_rectangles(double X,double Y, double Z)
{ // X,Y size of plate 1
  // X,Z size of plate 2
  //Plate 1 and plate 2 are perpendicular to each other 
 double H=Z/X;
 double W=Y/X;
 double x1=W*Math.atan(1.0/W)+H*Math.atan(1.0/H);
 double y1=Math.sqrt(H*H+W*W);
 double x2=y1*Math.atan(1.0/y1);
 double y2=(1+W*W)*(1+H*H);
 double y3=1+W*W+H*H;
 double x3=y2/y3*Math.pow((W*W*y3/y2),W*W)*Math.pow((H*H*y3/y2),H*H);
 double x4=1.0/(Math.PI*W)*(x1-x2+0.25*Math.log(x3));
 double Fij=x4;
 return Fij;
}

public static void main(String arg[])
{double F12=F_perpendicular_rectangles(1.0,1.0,1.0);
 double F13=F_perpendicular_rectangles(1.0,1.0,0.5);
 double F23=F12-F13;
 double eps1=0.8;
 double eps2=0.9;
 double A1=0.5;
 double A2=1.0;
 double R1=(1-eps1)/(eps1*A1);
 double R2=1.0/(F23*A2);
 double R3=(1-eps2)/(eps2*A2);
 double R=R1+R2+R3;
 double Q=5.67e-8*(1200.0*1200.0*1200.0*1200.0-800.0*800.0*800.0*800.0)/R;
 System.out.println("F12="+F12+"F13="+F13+"F23="+F23+"R1="+R1+"R2="+R2+"R3="+R3+"R="+R+"Q="+Q);
}
}