0
$\begingroup$

Given two angles (the starts and end of an arc), e.g. 90 degrees to 180 degrees, I need to output the starting and ending degrees of a small arc, and a large arc.

In this case the small arc is simply 90 to 180 (no change needed). The large arc would be 90 to -180.

Another example:

45degrees -> 270degrees    Small: 45degrees -> -90degrees    Large: 45degrees -> 270degrees (no change from original) 

I originally thought that subtracting 360 from one of the angles would work, but it doesn't seem to work in all cases.

Any ideas?

  • 0
    I can't think of any case where subtracting 360 doesn't work. What did you have in mind?2012-01-28
  • 0
    For example, if starting with 315degrees & 90degrees, we could only get the "smaller arc" by subtracting 360 from 315, and not touching 90. So, in this case, changing the starting degree works, but the cases above, changing the ending degree works. So, if the solution is to subtract 360, how do I decide which one to subtract 360 from?2012-01-28
  • 1
    Assuming all angles given to you initially are between 0 and 360 degrees, can't you just subtract 360 from the larger angle? (I think this is what Gerry meant)2012-01-28
  • 0
    Ah, I see. Okay, I'll try that and report back. Thank you2012-01-28

1 Answers 1