Git Product home page Git Product logo

convex-hull's Introduction

Convex-Hull Generator

This program was developed as a part of assignment for the course Algorithm Design and Analysis (CS60007)

Checkout the problem statement here

What is convex-hull?

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

How to run the program?

  1. Clone the repository
  2. Run the following command in the terminal
g++ convex-hull.cpp -o p
  1. Run the executable file
./p <input_file>
  1. Three different svg files will be generated for each of the three cases (check readme.md for example)
  2. Open the svg files in browser to see the output

Input format:

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.

Example

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.

  1. Points with bounding box

aero_1

  1. Polygon from given points

aero_2

  1. Convex hull

aero_3

convex-hull's People

Contributors

yashpaneliya avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.