import java.io.*;
import java.util.*;

class Radyasyon{

    // girdi dosyasi :
    // mikronK - emisivite(dalga boyu)
    // IR datalari 20 C (293 K i‡in de§erlendirildi)
    static double s1=0;
    static double s2=0;
    public static double F(double slt)
    {
      // siyah cisim yuzdesi
      // slt mikrometre*K
      double s=14387.69/slt;
      double toplam=0;
      if(slt==0) return 0;
      for(int n=1;n<200;n++)
      {
      toplam+=Math.exp(-n*s)/n*(s*s*s+3.0*s*s/n+6.0*s/(n*n)+6.0/(n*n*n));
      }
      toplam*=15/(Math.PI*Math.PI*Math.PI*Math.PI);
      return toplam;
    }

    public static double F(double slt1, double slt2)
    {
     return (F(slt2)-F(slt1));
    }

    public static double eT(String dosya) throws IOException
    {  
       File myfile = new File(dosya);
       BufferedReader b= new BufferedReader(new FileReader(myfile));     
       boolean EOF=false;
       double sl1=0;
       double Fl1=0;
       double sl2=0;
       double Fl2=0;
       double Toplam=0;
       int flag=0;
       while (!EOF)
       {
       try
       { 
       sl2=Text.readDouble(b);
       if(flag==0) {s1=sl2;flag=1;}
       s2=sl2;
       Fl2=Text.readDouble(b);
       Toplam+=(Fl1+Fl2)/2.0*F(sl1,sl2);
       sl1=sl2;
       Fl1=Fl2;
       }
       catch (EOFException e)
       { 
       b.close(); 
       EOF=true;
       }

       } //while
       return Toplam;
    }

    public static double BBEP(double T)
    {
      return 5.67051e-8*T*T*T*T;
    }

    public static void main(String[] args) throws IOException
    {
     s1=0;
     s2=0;
     String s="IR1.txt";
     double elt=eT(s);
     double elt1=elt/F(s1,s2);
     System.out.println(""+elt);
     System.out.println("F("+s1+" - "+s2+") = "+F(s1,s2));
     System.out.println("duzeltilmis emmisivite : "+s1+" - "+s2+" = "+elt1);
     System.out.println("Toplam emmisivite : "+elt*BBEP(393)+" W/m^2");
     System.out.println("Toplam emmisivite : "+elt*BBEP(393)*0.59*1.195+" W");

    }
}
