How to determine if a vertical line segment intersects a circle?

Try mathworld.wolfram.com/Circle-LineInterse... this covers the geometry aspect of your problem quite well.

Try mathworld.wolfram.com/Circle-LineInterse..., this covers the geometry aspect of your problem quite well.

Greg Sexton: This looks very much like what I need but my problem that I have with it perhaps is that I'm not very good at math. If the discriminant > 0 does that mean there is always two intersections? I don't think that is the case but as is I'm not sure how to determine the correct point of intersection in that case.

Maybe I just need to look at it some more, but it certainly very easily answers my original question so thank you - but unfortunately I forgot to add the part that was actually troubling me in the original question. Thanks for the link though! – Joe.

F Oct 4 '10 at 9:24.

If C=(x0,y0) is the center, r the radius, and k the abscissa of the line, you have y = y0 +/- sqrt(r^2-(k-x0)^2), but no intersection if r.

I'm used to subscripts starting at 1 in math but I know they start at 0 in most programming languages so it may be a silly question. Also, the abscissa is the x coordinate in a (x,y) coordinate pair correct? I looked it up and that appears to be right but I'm not really sure.

Anyway, this answers my original question so thank you but unfortunately I forgot to also include that I need to be able to determine the points of intersection. – Joe. F Oct 4 '10 at 9:21 x0, y0 are simply names for the two coordinates of the center of the circle – enzotib Oct 4 '10 at 9:34.

Using the centre x,y of the circle, find the distance of this particular line from the centre. Refer now if this distance is > radius of the circle => the line won't intersect. Otherwise, it will.

Anirvan-majumdar: I apologize this isn't the solution I was seeking, although it answers my original question. Thank you for the response though! – Joe.

F Oct 4 '10 at 9:18.

Someone else has already asked this question on StackOverflow. Here is the link, for reference: stackoverflow.com/questions/1073336/circ....

Ari Patrick: Thanks, I've been reading through it but honestly it's a bit above my level of comprehension. I'm having trouble picking out what is the relevant information as I'm only interested in vertical line segments (which to my understanding are generally considered special case in this problem? ) I may be wrong though, but thanks anyway!

– Joe. F Oct 4 '10 at 9:19.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions