Movable min and max rotation limits.

Hi there.
I have a problem. In my little picture you can see what i want to achieve. I want to be able to rotate the yellow dot around the circle, but when it reaches either the green or blue limit, it must then push those limits along. So if it reaches blue then it must move blue towards green and shrink the cyan colored area. I have tried using dot products and cross products to figure out if i am on the left or right of a limit, and then check if i am in the upper or lower half, but it doesn’t work. It pushes it along, but when I then go around the other way, it will snap to my yellow dot when I reach a certain spot. Any ideas on how this might be achieved?

Use angles. You can use the position of the dot relative to the centre to know which quadrant the dot is in. Then arcsin/cos can give you the angle. Then look to see how yellow angle compares to blue and green angles. Maybe dealing with the boundary between 0 degrees and 360 degrees might be awkward.