implementing this on MATLAB for my project.
I have a circle divided up to 3 arcs. So the angle range of each arc is [0,120), [120,240), [240,360) degrees.
Right now I have a code that finds whether the angle lies in arc A, B, C given any theta.
theta = mod(theta,360);
if theta >= 0 && theta < 120
Arc = A;
elseif theta >= 120 && theta < 240
Arc = B;
elseif theta >= 240 && theta < 360
Arc = C;
This works just fine. Here is the situation that I am struggling to get to:
The circle can rotate by the angle phi.
So for example, if the circle rotated clockwise 30 degrees, the range of my angle will be [30,150), [150,270), [270,390)
How should I write my if statement to deal with this case? My theta input can range from 0 to infinity, so I tried to do modulus division to get to [30,150), [150,270), [270,30)
but now I am stuck how to make it generalized so it can work for any input of theta and phi input that ranges from [0,360)
Thanks in advance with your advise.