Line & Circle Intersects

Determine if a line intersects a circle and the point(s) of intersect.
Scenerio:
Determine if, and where, a line intersects a circle:

1.) Black Line - Outside the circle; tested false for start/end points being inside the circle.

2.) Aqua Line - A line from outside the circle that intersect: find its circle intersect point.

3.) Blue Line - A line from the center circle through it circumference: find its circle intersect point.

4.) Red Line - Testing a line inside a circle, but has no intersect

5.) Green Line - Testing line starting inside a circle that intersects circle at one point.

6.) Orange Line - A line starting/ending outside circle that intersects circle at two points

7.) Maroon Line - A line from the center circle to a point within the circle: Extend line to its circle intersect point.


SVG Source:
Javascript:

OK in:IE11/CH41/FF35