[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[task #13658] Work on concave polygons too

From: Sachin Kumar Singh
Subject: [task #13658] Work on concave polygons too
Date: Mon, 6 Apr 2020 18:37:24 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0

Follow-up Comment #40, task #13658 (project gnuastro):

All things are done according to the requirements. Also the
`gal_polygon_sort_vertex` function, until now, returned the array of output
points rather than indexes(as ordinds). The latest commit
<> fixes
that and puts point structure in polygon.c.(I also toyed with the idea of a
map to sort, but it turned out to be rather redundant and overkilling so was
dropped altogether).

For storing indexes in ordinds, I used a linear search algorithm giving a
worst case of O(n^2). A binary search (O(log2(n))seems to be a better
alternative but as the size of array won't be very
large(GAL_POLYGON_MAX_CORNERS == 50) I think a linear search won't be that

Documentation and a slight error(a silly whitespace) will be fixed and rebased
as soon as the final commit gets a green flag:-)


Reply to this item at:


  Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]