I have a circle with two points inside it that make up a line segment. How can I calculate the distance from one endpoint to the edge of the circle where the line would intersect it?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think the easist way is to figure out where the intersection of the line and the circle is, then just calculate the distance from the line segment point with the intersection point.
So, say your circle is described by the equation
and your line segment is points like
First, you figure out the equation for the line that is directly over the segment, which, in this case, would be
You then substitute this equation into the first equation, and you get
Simplify this into
and solve via the quadradic formula.
You now have the x coordinates of the two intersection points. From there, plug into the line equation to get the y coordinates. Then you can just do normal point distance calculation ala Pythagoras.