function q = gauss6 ( a, b, f )

  n = 6;

  x = zeros ( n, 1 );
  x(1) = -0.932469514203152027812301554494;
  x(2) = -0.661209386466264513661399595020;
  x(3) = -0.238619186083196908630501721681;
  x(4) = 0.238619186083196908630501721681;
  x(5) = 0.661209386466264513661399595020;
  x(6) = 0.932469514203152027812301554494;

  w = zeros ( n, 1 );
  w(1) = 0.171324492379170345040296142173;
  w(2) = 0.360761573048138607569833513838;
  w(3) = 0.467913934572691047389870343990;
  w(4) = 0.467913934572691047389870343990;
  w(5) = 0.360761573048138607569833513838;
  w(6) = 0.171324492379170345040296142173;
%
%  Transform from [-1,+1] to [a,b].
%
  x = ( ( 1.0 - x ) * a + ( 1.0 + x ) * b ) / 2.0;
  w = w * ( b - a ) / 2.0;

  q = w' * f ( x );

  return
end
