Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added in CH_andrew #71

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Commits on Jul 29, 2020

  1. added in CH_andrew

    AGIS DANIELS EDITS 
    I made this compressed version of the code from c++ and a python version on wikibooks 
    toVec was moved to sub as toVec(a,b)== b-a 
    tested this on 2 kattis problems 
    my own version works on tested on 4 problems but it requires area and perimeter to work 
    ccw and cross are almost the same in python as in c++
    i added in a few things into the point class for it to solve the two convex hull problems on kattis that i tested on
    projectPythonator authored Jul 29, 2020
    Configuration menu
    Copy the full SHA
    74eec1f View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2020

  1. consistency

    Agis Daniels
    for consistency reasons i removed sub and re added vec 
    ccw already used it in a difference file so i just used it from the points line .py as well < had a more elegant version from that file too so i used it here too
    retested and still holds ac on kattis
    projectPythonator authored Jul 30, 2020
    Configuration menu
    Copy the full SHA
    3155940 View commit details
    Browse the repository at this point in the history
  2. added in the area

    Agis Daniels
    nice one liner for area 
    i called cross product function to avoid the need to retype the code again 
    should help avoid typos when implementing it from paper 
    the less than for point seems to work nicely with floats :)
    also added a oneliner version of the perimeter function above the code as well
    projectPythonator authored Jul 30, 2020
    Configuration menu
    Copy the full SHA
    fc12bae View commit details
    Browse the repository at this point in the history
  3. Merge pull request #1 from projectPythonator/AgisDaniels

    Agis daniels
    projectPythonator authored Jul 30, 2020
    Configuration menu
    Copy the full SHA
    8aab900 View commit details
    Browse the repository at this point in the history
  4. added in dot normsq and angle

    Agis Daniels
    they already existed in other files polyline.py is where i took these ones from
    also why is origin needed in the alt version of polygon area ??
    projectPythonator authored Jul 30, 2020
    Configuration menu
    Copy the full SHA
    e340872 View commit details
    Browse the repository at this point in the history
  5. added in code for collinear

    Agis Daniels
    already existed in pointlines file so i just used the one from there
    projectPythonator authored Jul 30, 2020
    Configuration menu
    Copy the full SHA
    f3c5849 View commit details
    Browse the repository at this point in the history
  6. added in isConvex

    Agis Daniels
    the code i use in my own implementation is similar so i can just swap out my call with ccw as its similar to the c++ code :)
    projectPythonator authored Jul 30, 2020
    Configuration menu
    Copy the full SHA
    35386a9 View commit details
    Browse the repository at this point in the history
  7. insidePolygon

    Agis Daniels
    im a bit iffy on insidePolygon as i tried to implment it before both like this and super mega compressed version and it had some errors for some reason 
    the second loop had errors i mean 
    will need to ask suhendry about it
    projectPythonator authored Jul 30, 2020
    Configuration menu
    Copy the full SHA
    989a01f View commit details
    Browse the repository at this point in the history
  8. Merge pull request #2 from projectPythonator/AgisDaniels

    Agis daniels good to go
    projectPythonator authored Jul 30, 2020
    Configuration menu
    Copy the full SHA
    74ac3a5 View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2020

  1. removed two lines

    Agis Daniels edit
    be sure to remove these two lines and set them to 0 in the __init__ function 
    to my understanding those are class variables shared by all instances of the class as stated in this link
    https://docs.python.org/3/tutorial/classes.html#class-and-instance-variables
    projectPythonator authored Aug 2, 2020
    Configuration menu
    Copy the full SHA
    bd78be6 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #3 from projectPythonator/AgisDaniels

    removed two lines
    projectPythonator authored Aug 2, 2020
    Configuration menu
    Copy the full SHA
    23b60fd View commit details
    Browse the repository at this point in the history

Commits on Aug 13, 2020

  1. rest of functions implmented

    I coded up the rest of the functions while trying to stay true to the source code from c++
    i ran into some bugs for CH_Graham scan which i need help understanding
    projectPythonator authored Aug 13, 2020
    Configuration menu
    Copy the full SHA
    4c262ca View commit details
    Browse the repository at this point in the history
  2. Update polygon.py

    projectPythonator authored Aug 13, 2020
    Configuration menu
    Copy the full SHA
    668d24c View commit details
    Browse the repository at this point in the history
  3. Merge pull request #4 from projectPythonator/AgisDaniels

    Agis daniels
    projectPythonator authored Aug 13, 2020
    Configuration menu
    Copy the full SHA
    bf15dc1 View commit details
    Browse the repository at this point in the history