View Full Version : Intersection of line and circle
I'm trying to find the points of intersection
of line and circle with equations:
(x-p)^2 + (y-q)^2 = r^2
(y-y1)*(x2-x1)-(x-x1)*(y2-y1)=0
but i can't handle with this. Can anyone help me?
ComputerGeek
Oct20-05, 11:56 PM
I'm trying to find the points of intersection
of line and circle with equations:
(x-p)^2 + (y-q)^2 = r^2
(y-y1)*(x2-x1)-(x-x1)*(y2-y1)=0
but i can't handle with this. Can anyone help me?
What do you know about the circle's dimensions?
mathman
Oct21-05, 05:04 PM
Your second equation (the line) can be simplified to look like y=mx+b (I assume x1, x2,y1,y2 are constants). Substitute mx+b for y in the first equation. You now have a quadratic in x. Solve for x, 2 real roots gives points of intersection, 1 root is tangency point, 0 real roots means no intersection. If x roots are real, use second equation to get y values.
Special case x1=x2, then x comes right out of second equation and 2 values of y can be found. Above comments about real roots and intersections apply. Line happens to be vertical.
SachinKainth
Aug10-07, 03:03 PM
Your second equation (the line) can be simplified to look like y=mx+b (I assume x1, x2,y1,y2 are constants). Substitute mx+b for y in the first equation. You now have a quadratic in x. Solve for x, 2 real roots gives points of intersection, 1 root is tangency point, 0 real roots means no intersection. If x roots are real, use second equation to get y values.
Special case x1=x2, then x comes right out of second equation and 2 values of y can be found. Above comments about real roots and intersections apply. Line happens to be vertical.
I see how the case where the line is not vertical works but I don't see what you would do in the case where it is vertical. Can you explain in a little more detail?
vBulletin® v3.7.6, Copyright ©2000-2009, Jelsoft Enterprises Ltd.