Possible Duplicate:
intersection of line and circle with different slope
I have line which plotted by pp=randi([-400 400],2,2)
then x=pp(:,1)
and y=pp(:,2)
. I have a circle with centre (a,b) with radius r
I want to check the intersection point of circle and the line.
I have used polyfit
command to check the slope and intercept. Then I used lincirc
command but the problem is if the line crosses only one point then the other point is also shown.
For example, if the line crosses one side and stops in the middle, it shows the other point as well which will not cross the boundary