So I have a arbitary line (See an example shown in fig 1) made up of n points<
If you have the points of the line segments, you can easily create two parallel lines to each segment and calculate the connection point where they intersect with the next if they were lines (and not line segments). This site should give you all you need to calculate super fast intersections:
http://www.math.niu.edu/~rusin/known-math/95/line_segs