This is a question for an issue I have run into while writing code. Assume that I have three points $A=[\cos\alpha,\sin\alpha]$, $B=[\cos\beta,\sin\beta]$, and $C=[\cos\gamma,\sin\gamma]$ on a unit circle. Further assume that $B$ and $C$ are fixed, but that the point $A$ can be moved around the circle's circumference.
Now my question: What conditions can I check efficiently to ensure that $A$ is not moved outside the arc between $B$ and $C$ originally containing it?
As a point of clarification: I do not just wish to detect whether the point is on this arc or not, but I seek some quantifiable conditions (e.g., distance along the circumference or differences in angles) which allow me to detect when point A is moved outside this arc. I have sketched three setups to illustrate what I mean:
where I wish to restrict A to the red arcs. Here are two conditions I considered, but found problematic to implement:
- Limit point A's angle $\alpha$ in radians between the angles $\beta$ and $\gamma$. Unfortunately, this naive case only works in scenario (a) above. If the arc to which A is restricted crosses the (in my case, western) discontinuity from +pi/-pi, a naive upper and lower bound won't work.
- Calculate the arc length between $A$ and $B$ and between $A$ and $C$, then ensure that the sum of these lengths does not change as $A$ is moved. Unfortunately, while solutions such as this one provide a way to calculate this distance, it always returns the shorter distance. In scenario (c) above, however, this would not give us the correct arc between $A$ and $B$.
