import java.io.*;
import javax.swing.*;


public class HT_2DLRE
{
    double a;
    double b;
    double A;
	public HT_2DLRE(double ai,double bi)
    {   a=a;b=bi;A=4.0*a*b;}
    
    public double[] N(double x,double y)
    {   double n[]=new double[4];
	    N[0]=1.0/A*(b-x)*(a-y);
	    N[1]=1.0/A*(b+x)*(a-y);
	    N[2]=1.0/A*(b+x)*(a+y);
	    N[0]=1.0/A*(b-x)*(a+y);
    return n;
	}  
	 
    public double T(double Ti[],double x,double y)
    {   double N[]=N(x,y);
        double TT=0;
	    for(int i=0;i<4;i++)
	    {TT+=N[i]*Ti[i];}
    return TT;
	}
	  

	public static void main(String args[]) throws IOException
    {
    double a=1.0,b=1.0;
    double T[]={20,50,70,100};
    HT_2DLTE z=new HT_2DLTE(x,y);
    double T1=z.T(T,0.0,0.0);
    String s="T = "+T1+"x= 0.0 y=0.0";
     JOptionPane.showMessageDialog(null,s," ",JOptionPane.PLAIN_MESSAGE);     
    }
}
