function value = pyramid_volume ( r, h )

%*****************************************************************************80
%
%% pyramid_volume() returns the volume of a pyramid with square base.
%
%  Discussion:
%
%    A pyramid with square base can be regarded as the upper half of a
%    3D octahedron.
%
%    Z - R <= X <= R - Z
%    Z - R <= Y <= R - Z
%    0 <= Z <= H.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    31 July 2018
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real R: the "radius" of the pyramid, that is, half the
%    length of one of the sides of the square base.
%
%    real H: the height of the pyramid.
%
%  Output:
%
%    real VALUE: the volume of the pyramid.
%
  value = ( 4.0 / 3.0 ) * h * r * r;

  return
end
