function [ x, w1, w2 ] = kronrod_adjust ( a, b, n, x, w1, w2 )

%*****************************************************************************80
%
%% kronrod_adjust() adjusts a Gauss-Kronrod rule from [-1,+1] to [A,B].
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    23 August 2015
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real A, B, the endpoints of the new interval.
%
%    integer N, the order of the rule.
%
%    real X(N+1), W1(N+1), W2(N+1), the abscissas and weights.
%
%  Output:
%
%    real X(N+1), W1(N+1), W2(N+1), the adjusted abscissas and weights.
%
  x(1:n+1) = ( ( 1.0 - x(1:n+1) ) * a   ...
             + ( 1.0 + x(1:n+1) ) * b ) ...
               / 2.0;

  w1(1:n+1) = ( ( b - a ) / 2.0 ) * w1(1:n+1);
  w2(1:n+1) = ( ( b - a ) / 2.0 ) * w2(1:n+1);

  return
end
