Ok, I see the advantage of that now that you've said it (about the containment of the range being tested, within one of the existing ranges, and how that makes it simple to test). But what do i do across the polar axis (the +'ve x-axis in cartesian). Currently I produce 3 results in my method ..
List<Vector2>ComputeOccludingArcsOfSegment(float x1, float y1, float x2, float y2)
1. a single range [alpha,beta] there are 5 cases for this
2. 2 ranges, [alpha,2Pi] & [0,beta] there are 3 cases for this (where the segment is bisected by the polar axis)
3. null there are two cases for this, point and segment intersecting the relative origin.
I don't see how I can measure a range that goes from negative into positive, and have it be meaningful to a range being tested. I could keep the arc starting angle and it's sweeping angle, is that one way to do it ? Or maybe as long as I know the lower angle, and understand that it's floating point value may actually be higher than the upper angle of the range, then is that ok ? Am I just then testing lower against lower and upper against upper (for containment)
Edit : deleted the edit.
Edit 2 : Ok, so here is an example of what I don't understand ..
Let's say I have an existing occluding range 315 to 45 degrees.
How do i test if the range 0 - 20 is contained ? ... 20 < 45, but what about 0 to 315. I don't see a simple comparison.
Edited by Gavin Williams, 07 August 2013 - 10:19 AM.