Skip to content

Commit

Permalink
more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
anvaka committed Oct 6, 2018
1 parent 20f64f8 commit 46cd78a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ segments.

[Try the demo online](https://anvaka.github.io/isect/)

# Methods
# Algorithms

The library implements two methods
The library implements two algorithms

## Bentley-Ottmann sweep line algorithm

Expand Down Expand Up @@ -194,13 +194,11 @@ will not be reported.
* The source code for the demo is [available here](https://github.com/anvaka/isect/tree/master/demo/interactive).
* The sweep line algorithm requires a binary search tree. I'm using [w8r/splay-tree](https://github.com/w8r/splay-tree) for this purpose. Love the library a lot!
I have also tried AVL tree, but found their performance worse than splay tree.
* The floating point rounding errors were driving me crazy during implementation of
this library. It is somewhat frustrating, since sweep line algorithm relies on order
of segments in the tree, which could be broken fairly easy with well-crafted test
case. If you need a sweep line with higher precision, consider porting this library to
* If you need a sweep line with higher precision, consider porting this library to
use [decimal.js](https://github.com/MikeMcl/decimal.js-light).
* I would absolutely love to have faster intersection algorithms implemented in JavaScript.
If you know any - please share. In particular this paper [An optimal algorithm for finding segments intersections](http://club.pdmi.ras.ru/moodle/file.php/15/Materials/p211-balaban.pdf) looks very promising!
Their runtime is `O(n * log(n) + k)` which should be faster than Bentley-Ottmann.


# Thanks!
Expand Down
2 changes: 1 addition & 1 deletion demo/interactive/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class='label'>Finding intersections...</div>
</div>
<div class='error' v-if='error'>
Rounding error detected.
Asserting failed in sweep line.
</div>
<a href='https://github.com/anvaka/isect' class='info'>Source code</a>
</div>
Expand Down

0 comments on commit 46cd78a

Please sign in to comment.