This program was developed as a part of assignment for the course Algorithm Design and Analysis (CS60007)
Checkout the problem statement here
Convex hull is the smallest convex polygon that contains all the points in a given set of points. It is also known as the convex envelope, convex closure, convex set, or convex figure. The convex hull may be visualized as the shape enclosed by a rubber band stretched around a finite set of points in the plane. For more information, checkout this
- Clone the repository
- Run the following command in the terminal
g++ convex-hull.cpp -o p
- Run the executable file
./p <input_file>
- Three different svg files will be generated for each of the three cases (check readme.md for example)
- Open the svg files in browser to see the output
n
g
x1 y1
x2 y2
.
.
.
xn yn
where n is the number of points, g is the origin point (bottom-left corner of the bounding box is at (g, g) after the translation) and (xi, yi) are the coordinates of the ith point.
Sample input file can be found here
Sample output files:
In output, three SVG files are generated. The first one is the input points, the second one is the polygon generated from input points, and the third one is the convex hull with the input points.