How to find end points of a chord, given the angle and a single point on line

This topic is 4760 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

I'm facing a problem; basically, what I want to know are the end-points of a line that touches two points on a circle (i.e. a chord). I have the following data: - Angle at which line is being drawn - A single point on line [also, I use this point and the angle to draw the line] - Center point of circle - Radius of circle I need this because I want to limit the chord end-points from exceeding edges of the circle. First, I draw the line, then I need to make this check, if the line is exceeding circle edges, clamp. The question is clear in my mind, if I'm not expressing it correctly, or more info is required, then let me know. Thank you all for your time..

Share on other sites
That decomposes to a simple line-circle intersection problem, which see here.

Share on other sites
umm..what is r2 (r square)? is it the radius of the circle?

And thank you for this link, it is very useful..

[EDIT: Radius was 'r'.. had pictures disabled on my browser and didn't explicitly enable that one..[smile]]

[Edited by - Taha Ansari on January 4, 2006 5:51:43 AM]

Share on other sites
I finally got it to work- I was trying the formula mentioned but hadn't read the part where it said circle had origin 0,0. When I took that into account, it worked like a...something that works a-ok.

Thank you very much Sneftel..

• What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 15
• 14
• 46
• 22
• 27
• Forum Statistics

• Total Topics
634048
• Total Posts
3015236
×