Code Monkey home page Code Monkey logo

quickhull's Introduction

QuickHull

This is an implementation of the QuickHull algorithm in Python. It randomly generates a set of points and finds the convex hull of this set of points using the Quickhull algorithm.

More details about QuickHull algorithm here: Quickhull Algorithm

Time Complexity

Time Complexity - O(n * log(r)) where n = total no. of points, r = no. of processed points

Worst-case Scenario - total no. of points (n) = no. of processed points (r). Example below.

If this code helped you visualize and understand the Quickhull algorithm, please give this repo a star! โญ

Results

Here are a couple of results:

quickhull_20.gif

Worst-case Scenario - Points in a Circle - Time Complexity O(n * log (n) )

quickhull_20_circle.gif

Installation/Setup

To get this code to run on your machine, you will need to follows these steps:

  • Clone this repo to your local machine using
git clone https://github.com/AnantJoshiCZ/QuickHull.git 
  • Install John Zelle's graphics.py
pip install graphics.py
  • Run quickhull.py

MacOS

If you're on the MacOS, you may need to install the Tkinter dependencies separately. To do this with Homebrew, use the following:

brew install python-tk

This will install any Tkinter/tkinter dependencies and allow you to use the graphics.py library. If you do not do this step, you may see an error when running the code. This is a common issue with the graphics.py library which is supposed to be a library for learning basic graphic concepts.

quickhull's People

Contributors

anantjoshicz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

claytonchagas

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.