This page is adapted the algorithm from the book Computational Geometry - Algorithms and Applications, 3rd Ed by Berg et. al. You can see details in chapter 1 example 1.1 An Example: Convex Hulls

Source