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

Emacs Lisp implementation of Graham scan #908

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

berquist
Copy link
Member

See #882 for book boilerplate.

I think there is some inconsistency both in

  • how some of the functions are supposed to be defined, such as return type for the CCW part and the "core" of the scan, and
  • what lines of code are included for which section in the book.

(hull (list start (car points) (cadr points))))
(dolist (point (cddr points))
(while (not (is-ccw (nthrev 1 hull) (nthrev 0 hull) point))
(setq hull (reverse (cdr (reverse hull)))))
Copy link
Member Author

@berquist berquist Oct 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably destroys the formal scaling of the method. Nevermind, this is still linear, just inefficient.

@leios leios added Chapter This provides a new chapter. (md files are edited) lang: emacs-lisp emacs lisp programming language labels Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chapter This provides a new chapter. (md files are edited) lang: emacs-lisp emacs lisp programming language
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants