"John D'Errico" <firstname.lastname@example.org> wrote in message <email@example.com>... > "John " <firstname.lastname@example.org> wrote in message <email@example.com>... > > I am trying to write a code that will measure the intersection point of a line and a circle in 3D Space. I have the initial point (x,y,z) that the line begins starts on, and I know the gradient for that line (deltaX,deltaY,deltaZ). I also have a center point for a circle (x,y,z), it's radius, and the plane it lies on (xy plane, xz plane etc...). What I want is to find out is if there is an intersection between the line and the circle, and then if so, what that intersection point is. I'm just having trouble getting the initial set up for the equations so that I can go ahead and start solving for my unknowns. Can anyone offer me some help? > > > > -John > > As us said, your question is not actually about matlab. > > But as importantly, you have not accurately specified > the problem. What do you mean by an intersection of > a line and a circle? A circle refers to the curve that lies > on the perimeter of a circular disk. In R^3, a line almost > certainly will not intersect the curve. Do you really mean > to ask if the line cuts through the interior of the circular > disk? > > You cannot solve a problem that you do not fully > understand. Even if you understand what your goal is, > if you do not explain it accurately, how can you expect > any intelligent help? > > I'll give you a hint. Try finding the intersection of the > line with the plane the circle lives in. How will you do > this? Now, how do you know if the located point of > intersection is inside a circle with a given center? Or, > if you are looking to see if the line actually intersects > the circle perimeter, how will you know if the line does > so? What property does the perimeter of a circle have? > > Good, well written code will worry about things like if > the line happens to fall in the plane itself, or if it is > parallel to the plane but does not intersect the plane at > all. > > John
I happen to have the same problem, and I wonder how this question was not clear to John. This problem is when you have the circle and the line both on one tilted plane and you want to find the two intersection points of the circle and the line, if any.