I think that this is basically a math problem, But I don't know how to be applied on programming.
I have to calculate the distance, in angle degrees, between two points on a circle.
I read the position of my cursor and I have to calculate the distance from a specific point of the circle.
For example the cursor is located at 350 degrees (acquired from a sensor) my "limit variable" is 10 degrees. I know that the eagle between the cursor and the limit is 20 degrees... but how can I program Arduino to make the operation?
I need to calculate the angle between Cursor position and Limit A. And The cursor position and Limit B.
Limit A and B are defined by user. Cursor position is acquired from a sensor that returns the position in degrees.
So what form of data are Limit A and Limit B expressed in?
If they are also degrees, then it is fairly straight forward A <=X<=B. Well, complicated by the fact that you have to recalculate zero to be at one of the limits, because normally degrees reset from 359 to 0 at the "north pole".
If they are locations, e.g. -40,-20 or 12,57 Then you want to convert them from rectangular to polar. Polar coordinates are a vector, that is, distance along a direction (degrees or radians).
After conversion you would then compare the degrees of all three.
I hate to duck the question, but if you need to convert rectangular to polar there are many resources available that are better than any explanation I could give.
You just have to know what you are searching for.
I think the OP is saying that angles A, B, and E are known, and they need to find angles C and D.
I've taken the liberty of showing A and B as measured CW from the red reference line, and E as CCW from the line. Also, C and D are shown as the smallest angles...
One thing missing is the question of "which side" do you consider "between" to be on?
The "cursor" position he drew is, by one argument, between A and B. However, there is a point 180 degrees opposite that is also "between" A and B. That is to say, there are two solutions as drawn, and we can guess that only one will be correct for his application.
I have no idea how the "cursor" is input, but if it can be arbitrarily placed without some other restrictions, such as a starting point that is assured to be "between", a single solution is impossible.
The example on the first post is clear: limit A: 10 degrees cursor position: 350 degrees.
Everything is defined in degrees. If a radius is needed to calculate the angle can be considered as 1