Answer the question
In order to leave comments, you need to log in
How to test if a cone and a circle have common points?
In continuation of this question. https://qna.habr.com/q/1048952
There is still a cone defined by a central line (with certain coordinates of points A and B) and a certain angle from this line. But now we need to check, by and large, whether these two figures have common points.
How to do it?
Answer the question
In order to leave comments, you need to log in
You can’t add a picture here, because words. We're supposed to be checking the common points of patches, not paths.
0) Find out the distance D between point A (which is the center of the "cone") and point O (the center of the circle).
1) If D > R+r, then they don't intersect - too far. (R and r are the radii of the "cone" and the circle).
2) If D <= r, then the center of the cone lies in the circle, and there are common points.
3) If D ^ 2 < R ^ 2 + r ^ 2, then to both angles Y from the previous task we add the angle X equal to arcsin (r / D), and thus expanding the sector, we arrive at the last task (without checking distances, only hitting a corner), if we take the center of the circle as a point.
4) Otherwise, we look at the point M - the intersection of a large and small circle. We determine the OAM angle equal to X. This angle can be found using the cosine theorem, since the sides of the OAM are known (R, r, D, the angle between sides R and D). Further with this X we do as in paragraph 3.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question