function value = p12_theta ( i, j )

%*****************************************************************************80
%
%% P12_THETA is a utility routine used in problem 12.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    03 September 2008
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer I, J, the indices of THETA.
%
%    Output, real VALUE, the value of THETA(I,J).
%
  nmax = 10;

  theta = [ ...
             1.0,       0.0,        0.0,        0.0,        0.0, ...
             0.0,       0.0,        0.0,        0.0,        0.0; ...
             1.0,       1.0,        0.0,        0.0,        0.0, ...
             0.0,       0.0,        0.0,        0.0,        0.0; ...
             1.0,       3.0,        3.0,        0.0,        0.0, ...
             0.0,       0.0,        0.0,        0.0,        0.0; ...
             1.0,       6.0,       15.0,       15.0,        0.0, ...
             0.0,       0.0,        0.0,        0.0,        0.0; ...
             1.0,      10.0,       45.0,      105.0,      105.0, ...
             0.0,       0.0,        0.0,        0.0,        0.0; ...
             1.0,      15.0,      105.0,      420.0,      945.0, ...
           945.0,       0.0,        0.0,        0.0,        0.0; ...
             1.0,      21.0,      210.0,     1260.0,     4725.0, ...
         10395.0,   10395.0,        0.0,        0.0,        0.0; ...
             1.0,      28.0,      378.0,     3150.0,    17325.0, ...
         62370.0,  135135.0,   135135.0,        0.0,        0.0; ...
             1.0,      36.0,      630.0,     6930.0,    51975.0, ...
        270270.0,  945945.0,  2027025.0,  2027025.0,        0.0; ...
             1.0,      45.0,      990.0,    13860.0,   135135.0, ...
       945945.0,  4729725.0, 16216200.0, 34459425.0, 34459425.0 ]';

  if ( i < 1 | nmax < i | j < 1 | nmax < j )
    fprintf ( 1, '\n' );
    fprintf ( 1, 'P12_THETA - Fatal error!\n' );
    fprintf ( 1, '  I or J is out of bounds.\n' );
    error ( 'P12_THETA - Fatal error!' );
  end

  value = theta ( i, j );

  return
end
