javascript - Convex hull - Monotone chain algorithm error -


i'm using monotone chain algorithm create convex hull around set of polygons. works sometimes, on shapes, fails. take @ example: http://i.imgur.com/kn40lgv.png

to left shape before applying algorithm, , right after. there seems minor calculation error somewhere, can't figure out.

here link source-code (javascript): http://pastebin.com/gpvm9dqp

and here implementation in python used reference: http://pastebin.com/rgmkh3xn

without digging deep it, aren't supposed sort list of points x-position @ point?


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -