function [F12, A1, F21, A2] = frustum2base(rb, rt, h)
%[F12, A1, F21, A2] = frustum2base(rb, rt, h)
%
%  Description:
%
%    View factor between the interior wall of a conical frustum and
%    its base.
%
%  Inputs:
%
%    rb = radius of base
%    rt = radius of top of conical frustum
%    h  = height of the conical frustrum
%
%  Outputs:
%
%    F12 = view factor from interior wall to base
%    A1  = area of the interior wall
%    F21 = view factor from base to interior wall
%    A2  = area of the base
%
%  Reference:
%
%    A Catalog of Radiation Heat Transfer Configuration Factors,
%    third edition, John R. Howell, The University of Texas at Austin
%
%      http://www.thermalradiation.net/sectionc/C-111.html
%
%==========================================================================

if rb <= rt
  error('frustum2base: Base radius = %f, must be greater than top radius = %f.',rb,rt)
end  

A1 = pi*(rb + rt)*sqrt((rt - rb)^2 + h^2);  %  Area of the wall
A2 = pi*rb^2;  %  Area of the base

H = h/rt;
R = rb/rt;
X = 1.0 + R^2 + H^2;

F12 = (2*R^2 - X + sqrt(X^2 - 4*R^2))/(2*sqrt(X - 2*R)*(1 + R));

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