Beta

Polygon Orientation

21 of 31acraileanu
Description
Loading description...
Algorithms
Geometry
Algebra
Mathematics
  • Please sign in or sign up to leave a comment.
  • Voile Avatar

    There are self-interacting polygons in the test cases, which don't have a well-defined orientation. Quoting from Wikipedia:

    For a self-intersecting polygon (complex polygon) (or for any self-intersecting curve) there is no natural notion of the "interior", hence the orientation is not defined

    In fact the author solution and most of the existing solutions can return either orientation depending on the shape (but not the topology) of the self-intersection polygon.

  • acraileanu Avatar

    New example added to description, for disambiguation.

  • OverZealous Avatar

    That was a very, very nice kata.

    I appear to be the only one to have come up with my solution so far, which may not be 100% correct, but passed all tests. :-)