function retval = HTrectangle(L,W,T1,T2,x)
  C=0;
  plusminus=1;
  teta=0;
  for n=1:100
    C=2.0*(plusminus+1)/(pi*n*sinh(n*pi*W/L));
    plusminus*=-1;
    teta+=C*sin(n*pi*x(1)/L)*sinh(n*pi*x(2)/L);
  endfor
  retval=teta*(T2-T1)+T1;
endfunction