gnuastro-devel
[Top][All Lists]
Advanced

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

[task #13658] Work on concave polygons too


From: Mohammad Akhlaghi
Subject: [task #13658] Work on concave polygons too
Date: Tue, 7 Apr 2020 17:56:56 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0

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

Great! Thanks a lot Sachin, you have the green flag :-). Just some minor
points are listed below to hopefully implement with the rebase:

* When including headers, and order doesn't matter for the
algorithm/compilation, please sort them by length. So in `polygon.c', include
the `float.h' before `stdlib.h'. Ideally, when the lengths are also equal, it
would also be more pleasing to sort them alphabetically ;-). The basic C
library headeres are usually independent of each other.

* It would help in readability if you don't include extra curly braces (`{' or
`}'). For example in `polygon_rightmost_point', the `if' statement is right
after the `for' statement and there is no other operation. So you can just
write it like below. Also note that as discussed above, because the
`max_index' line is independent of (doesn't affect) the `tmp_max' line, and
its shorter, its better for it to be above the `tmp_max' line ;-). I also see
a few such cases in `gal_polygon_vertices_sort' (the two `i' and `j' loops,
for the latter, you can just write it like this to be more readable:
`tordinds[i++]=B[j];').


  for(i=0; i<n; i++)
    if(tmp_max < in[i*2])
      {
        max_index = i;
        tmp_max = in[i*2];
      }


* Some static functions don't have a `polygon_' prefix (like `compareA' and
`compareB').

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/task/?13658>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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