Gradient on a line

HTML

<svg width="1024" height="800">
 <defs>
    <linearGradient id="grad1" x1="0%" y1="0%" x2="0%" y2="100%">
      <stop offset="0%" style="stop-color:#eee;stop-opacity:1" />
      <stop offset="100%" style="stop-color:#000;stop-opacity:1" />
    </linearGradient>
  </defs>
<line stroke="url(#grad1)" x1="50"
y1="50" x2="200" y2="300" stroke-width="3"></line>
<path stroke="url(#grad1)" d="M70 50L170 150" stroke-width="3"></path>
<path transform="rotate(180, 100, 0)" stroke="url(#grad1)" d="M70 50L170 150" stroke-width="3"></path>
</svg>