Line through Polygon Input: A line of the standard slope-and-intercept form: mx+b, as well as a set of Cartesian points determining the vertices of a polygon. Assume that the x and y values of the points will be integers.

Output: A boolean, which is true if the line enters or touches the polygon, and is false otherwise.

This is a little tricky, so I'll give a clue: turn the vertices that determine an edge into lines.

Test Cases
2x+3 (1,2) (2,5) (5,10) -&gt; False
5x+0 (5,10) (2,10) (2,-10) (5,-10) -&gt; True
0.5x+3.1 (1, 2), (-1, 2), (5, 8), (6, 7), (2, 10) -&gt; True

Shortest or most creative code wins. I don't know too many languages, so explain your algorithm in your post. Good luck!
Ruby, 103 101 characters
m,b,*q=gets.scan(/[\d\.]+/).map{|t|t.to_f}
s=t=!0
q.each_slice(2){|x,y|x=x*m+b;s|=x&lt;=y;t|=x&gt;=y}
p s&amp;t

Input is on STDIN in the form specified in the question while output goes to STDOUT.