Problem 194. Clockwise or Counterclockwise
Solution Stats
Problem Comments
-
3 Comments
added more samples to the test
Hello, Alfonso Nieto-Castanon. This is a very nice problem. It was interesting to see the variety of approaches used to solve it. It was also interesting to notice a few submissions failed your added test cases from circa Dec 2017. Do you allow for self-intersecting polygons, as per https://en.wikipedia.org/wiki/Polygon ?
I suspect a common solution tactic will fail badly when faced with self-intersecting polygons. —DIV
...On second thought, maybe there's no consistent definition of CW/CCW for self-intersecting polygons, such as figure-eight or bow-tie ("cross-quadrilateral") shapes.
Solution Comments
Show commentsProblem Recent Solvers110
Suggested Problems
-
Sum all integers from 1 to 2^n
13331 Solvers
-
Project Euler: Problem 8, Find largest product in a large string of numbers
981 Solvers
-
333 Solvers
-
1088 Solvers
-
String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values
1179 Solvers
More from this Author38
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!