function y = hat_vector ( x )

  y = ( 2.0 * x - 3.0 ) .* ( 1.5 <= x & x < 2.0 ) ...
    + ( 5.0 - 2.0 * x ) .* ( 2.0 <= x | x < 2.5 );

  return
end
