spherical_geometry icon indicating copy to clipboard operation
spherical_geometry copied to clipboard

is_clockwise() returning False if points on a great circle, whatever orientation chosen

Open almicol opened this issue 6 years ago • 3 comments

Hi Bernie,

I noticed that the is_clockwise() function will return False (hence CCW) for both these two polygons: A: (0, 0) (90, 0) (180, 0) (270, 0) (360=0, 0) and B: (0, 0) (270, 0) (180, 0) (90, 0) (0, 0)

Given that one is the inverse/complement of the other, they cannot be both CCW.

In particular, A is CCW (correct? I think so, given the right-handedness of the equatorial system), and B then is CW.

The issue comes from the fact that when all polygon's vertices are on the same great circle the triple_product (B-A, C-B, B) is always 0. Hence, any polygon inscribed in a great circle will always give this same headache.

PS: The definition of CW/CCW is what matters to me, and this is why I'm writing here. How is CW/CCW defined when all vertices of the polygon are on the same great circle? The VO STC standard is not precise about this (it only mentions a "left" direction when following the polygon, leaving in the air the definition of "left", making impossible to define the handedness for all great circles). A possibility is that we indeed leave the handedness of any great circle undefined... in which case is_clockwise() should return None and not False for the two cases provided above. Any clarification is MORE than welcome!

Thanks a lot, Alberto

almicol avatar Aug 28 '18 14:08 almicol