Tag <line>supports only the start and end attributes ( x1, y1, x2, y2). Thus, you will need to manually select the x coordinates outside the canvas and use y2= y1+ m ( x2- x1).
Edit
Looking through the specification, it is possible to convert individual elements as needed:
<line ... transform="translate(x, y) rotate(theta)" />
theta - .
, (-10000, 0) (10000, 0), , :
<line x1="-10000" y1="0" x2="10000" y2="0" transform="translate(150, 200) rotate(-30)" />
( , ) (150, 200) π/6 .