Possible Duplicate:
Circle line collision detection
How do I find the intersection of a circle and a line (not straight) with different slope.
The points for the line is shown below:
theta=0:.01:2*pi;
x1=5*cos(theta)+4;
y1=5*cos(theta)+1;
x=[1 1 4 7 7 8 8 8]
y=[2 3 3 3 5 8 8 8]
And also, how do I calculate the length of this line?