function R = minimal_surface_linear_residual ( X, Y, a, b, c )

%*****************************************************************************80
%
%% minimal_surface_linear_residual(): minimal surface residual for linear solution.
%
%  Discussion:
%
%    The equation is:
%      (1+Ux^2) Uyy - 2 Ux Uy Uxy + (1+Uy^2) Uxx = 0
%
%    The linear solution is:
%      U(X,Y) = a * X + b * Y + C
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    29 May 2025
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real X, Y: the coordinates of the points.
%
%    real a, b, c: parameters.
%
%  Output:
%
%    real R: the residual evaluated at the points (X,Y).
%
  [ U, Ux, Uy, Uxx, Uxy, Uyy ] = minimal_surface_linear_exact ( X, Y, a, b, c );

  R = ( 1.0 + Ux.^2 ) .* Uyy ...
    - 2.0 * Ux .* Uxy .* Uy           ...
    + ( 1.0 + Uy.^2 ) .* Uxx;

  return
end
