function p = poisson_kernel ( r, n, c, x, y )

%*****************************************************************************80
%
%% poisson_kernel() evaluates the Poisson kernel.
%
%  Discussion:
%
%    P(X,Y) = ( R^2 - |X-C|^2 ) / ( R * A * |X-Y|^N )
%
%    where the N-dimensional ball has radius R and center C,
%    and A is the area of the unit sphere.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    22 November 2011
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real R, the radius of the ball.
%
%    integer N, the spatial dimension.
%
%    real C(N), the center of the ball.
%
%    real X(N), a point inside the ball.
%
%    real Y(N), a point on the surface of the ball.
%
%  Output:
%
%    real P, the Poisson kernel function P(X,Y).
%
  xc_diff_norm = r8vec_diff_norm ( n, x, c );
  xy_diff_norm = r8vec_diff_norm ( n, x, y );
  area = sphere_unit_area_nd ( n );

  t = ( r + xc_diff_norm ) * ( r - xc_diff_norm );
  b = r * area * ( xy_diff_norm ) ^ n;
  p = t / b;

  return
end
