I am trying to make a funciton to draw an arrow on the tip of any line.

All I need to know is how to find the coordinates of a point n away from the end of the line if I am given x1,x2,y1,and y2. The line should be able to vary in slope and position