- Home /
Maths: Given a point on a circle and a fixed length line. Find the next closest point on the circle.
This one's got me. Look at the image, I have the green X and the blue line's length, but I need the red X's position. Not sure if I need to be calculating a direction or not? Thanks in advance.
Like you wrote, it's a math problem. $$anonymous$$ath sites will give better answers. There's a good chance the solution is in your old High School trig textbook.
I tried various searches but nothing came up. It's hard to word my problem to search for.
I'm also british, so high school doesn't exist. We have terrible education, we did very basic trigonometry, never made it past SOH CAH TOA sort of stuff. They also made it seem so very very boring, no one was interested, they never once mentioned what fun things you could actually do with it. We all just saw letters and numbers together and were like "noooo". Even when we asked what can be done with trigonometry, the $$anonymous$$chers said "a lot". When it came to the actual $$anonymous$$ching, we were just made to do like 50 very slightly different problems at a time. Just to get the pattern fixed in our heads, no explanation as to what the results mean, what they are used for etc. I was in the highest class aswel so I hope that says something. We were hardly ever given textbooks, and when we were, they were given out in class, and only for use in class, never outside of class.
Sorry for the rant!
Answer by dagon · Jan 12, 2015 at 02:54 AM
you need have circle center postion O
you should calculate angle bettween O-Xred and O-Xgreeen angle A = 2*arcsin((blue line's length/2)/(O-Xgreeen length))
last you can calculate O-Xred by rotate O-Xgreeen angle A by multiply O-Xgreeen with quaterion euler of A
Yeah that beats my solution. Didn't think to approach it that way.
Perfect! Thank you!
Bored$$anonymous$$ormon you provided some good reference tho, good stuff to know!
Answer by Kiwasi · Jan 12, 2015 at 02:45 AM
This problem is the equivalent of finding the intersection of two circles. Try googling that and see if you come up with a suitable algorithm.
Note that there are two solutions to this problem, you will have to do a sanity check to figure out which one is correct.
This link looks pretty decent.