A
A
antonwx2021-09-17 15:00:15
Geometry
antonwx, 2021-09-17 15:00:15

How to check if a point on a plane belongs to a specified part of a circle?

The initial data are as follows: there are points A and B, their coordinates are known. A line of length \u003d X, coming from point A, and passing through point B, is the radius of the circle. The angle between this line and the line that cuts off part of such a circle is Y. (the second line has exactly the same Y angle). How can one test an arbitrary point for belonging to this part of the circle, which is cut off by two such lines?
6144834baba1b573706807.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
Wataru, 2021-09-17
@antonwx

First, check that the point lies inside the circle (just compare the distance to A).
Secondly, it is necessary to check that the point lies in the sector. There are 2 options here. You can get the angles of the borders and the direction to the point through the arc tangent and compare, but there are many special cases, especially when passing through 0. An alternative is to use vectors. Let the desired point be P. Then you need to check that the vector AP makes an angle less than y with the vector AB. You can find the cosine of an angle using the scalar product and then compare it with the cosine of y.
You want (AB,AP)/(|AB|*|AP|) >= cos y

G
GavriKos, 2021-09-17
@GavriKos

https://qna.habr.com/q/112339

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question