Circle and Line segment intersection I have a line segment (begin $(x_1,y_1)$, end $(x_2,y_2)$, with $D=5$, let’s say) and a circle (radius $R$, center $(x_3,y_3)$)
How can I check that if my line segment intersects my circle?
picture 
http://kepfeltoltes.hu/120129/inter_www.kepfeltoltes.hu_.png

Compute the distance of the line passing through $(x_1,y_1)$ and $(x_2,y_2)$ from $(x_3,y_3)$. If it is less than $r$, then the line passing through the two points intersects the circle else not. If it does, you are still not sure if the line segment intersects or not (it can be the line that is intersecting), so just find the distance of the two points from the center. If exactly one is less than $r$, then it is intersecting. The solution won't involve solving any quadratic equation. 
