function y = hat ( x )

  if ( x < 1.5 )
    y = 0.0;
  elseif ( 1.0 <= x && x < 2.0 )
    y = 2.0 * x - 3.0;
  elseif ( 2.0 <= x && x < 2.5 )
    y = 5.0 - 2.0 * x;
  else
    y = 0.0;
  end

  return
end
