r/MathHelp • u/adam717 • Aug 22 '21
How can I find the intersection points of a line with a circle in R^3?
Suppose we have a circle in R3 with a center C = [cx, cy, cz] and with a normal vector to the circle N = [nx, ny, nz] and a radius of the circle r. Also suppose that we have two points in R3, P and Q. If it's true that the line that runs through P and Q intersects this circle, how can I find the points of intersection among the line and circle?
I suppose that maybe we can parameterize a line P + t(P - Q) and then solve for the value(s) of t for where the line intersects the circle. The thing is, I don't know of an easy way to do this like how it can be done in R2. Also, if there is an easier way to solve for these intersection points other than parameterizing lines, I would prefer that method.
1
u/AutoModerator Aug 22 '21
Hi, /u/adam717! This is an automated reminder:
What have you tried so far? (See Rule #2; to add an image, you may upload it to an external image-sharing site like Imgur and include the link in your post.)
Please don't delete your post. (See Rule #7)
We, the moderators of /r/MathHelp, appreciate that your question contributes to the MathHelp archived questions that will help others searching for similar answers in the future. Thank you for obeying these instructions.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
2
u/floydmaseda Aug 22 '21
Given the coordinates of P and Q, I'd use your parameterization (note you have a sign error, though, at least if you want to use the "standard" parameterization.. should be Q-P instead of P-Q), then to find points on the circle, the distance from C to P+t(Q-P) should be r. Should be the same level of difficulty as in R2, as the resulting equation will still be quadratic in t.
To find the coordinates of the point(s) of intersection, just plug in the determined values of t into your parameterization.
Technically the above would find any intersections with the sphere with center C and radius r, but if the assumption is that there is indeed an intersection with the circle, that's the same thing. If you didn't have that assumption, you could check if the vector P+t(Q-P)-C is orthogonal to the normal vector N by seeing if the dot product is zero.
Of course, if values of t from the quadratic are complex, that indicates no such point along the line intersects even the sphere so definitely cannot intersect the circle.