I wrote an implementation of Graham's Scan convex hull algorithm and for test data I used the points
[(2.0,2.0),(4.0,2.0),(0.5,2.5),(3.0,3.5),(1.0,4.0),(0.0,4.0),(1.0,1.0),(3.0,2.5),(4.0,4.0),(3.5,1.5),(0.5,1.0)]
According to my program the convex hull is
[(0.0,4.0),(1.0,4.0),(4.0,4.0),(3.0,2.5),(4.0,2.0),(3.5,1.5),(1.0,1.0),(0.5,1.0)]
However, I expected the convex hull to be
[(0.0,4.0),(1.0,4.0),(4.0,4.0),(4.0,2.0),(3.5,1.5),(1.0,1.0),(0.5,1.0)]
I tried my set of points with https://github.com/shadwstalkr/GrahamScanDemo/ as well and that gives the same solution as well. After much complaining and grumbling I read on wikipedia that "An object is convex if for every pair of points WITHIN the object, every point on the straight line segment that joins them is also within the object."
After drawing out my points and hull. It appears that my program produced an object within that definition, however wouldn't that mean that just simply sorting by the angle would give a convex hull as will without any points in the hull?
Do I not understand what a convex hull actually is and I am tying to solve a different problem or is both my implementation and shadwstalkr incorrect?