function [F12, A1, F21, A2] = plate2plate(a, b, c)
%[F12, A1, F21, A2] = plate2plate(a, b, c)
%
%  Description:
%
%    View factor between two coaxial rectangular surfaces.
%
%  Inputs:
%
%    a = width of rectangle surface
%    b = depth of rectangle surface
%    c = distance between the two surfaces
%
%  Outputs:
%
%    F12 = view factor from lower rectangle to upper rectangle
%    A1  = area of the lower rectangle
%    F21 = view factor from upper rectangle to lower rectangle
%    A2  = area of the upper rectangle
%
%  Reference:
%
%    A Catalog of Radiation Heat Transfer Configuration Factors,
%    third edition, John R. Howell, The University of Texas at Austin
%    C-11: Identical, parallel, directly opposed rectangles.
%    http://www.thermalradiation.net/calc/sectionc/C-11.html  
%
%==========================================================================

if c <= 0.0
  error('FATAL ERROR in plate2plate: distance between the plates, c = %d, must be greater than zero.',c)
end

A1 = a*b;  %  lower plate area
A2 = A1;   %  upper plate area

X = a/c;
Y = b/c;

F12 = (2/(pi*X*Y))*(log(sqrt(((1 + X^2)*(1 + Y^2))/(1 + X^2 + Y^2)))  ...
      - X*atan(X) - Y*atan(Y) + X*sqrt(1 + Y^2)*atan(X/sqrt(1 + Y^2))  ...
      + Y*sqrt(1 + X^2)*atan(Y/sqrt(1 + X^2)));

F21 = F12*A1/A2;  %  F12*A1 = F21*A2
