[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[task #15578] Function to find if polygon vertices are sorted anti-clock
From: |
Mohammad Akhlaghi |
Subject: |
[task #15578] Function to find if polygon vertices are sorted anti-clockwise |
Date: |
Mon, 23 Mar 2020 20:00:30 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0 |
Follow-up Comment #4, task #15578 (project gnuastro):
Thanks a lot Sachin, this is a very clean commit and I enjoyed reading the
`git log -1 -p' :-).
But as I read more into it I recognized that this is only one part of this
task's aim: finding if the *ordered* set of points are clock-wise or counter
clock-wise.
Before that, we should make sure if the polygon is indeed ordered or not. For
example say I have the simple polygon of (0,0), (0,1), (1,1) and (1,0) which
is ordered counter-clockwise. But what if the user gives the points like this:
(0,0), (1,1), (1,0) and (0,1). We need a function to see if the given set of
points is already sorted or not (to possibly pass onto the sorting algorithm
and avoid sorting if its not necessary (especially since there isn't a unique
sort for concave polygons).
However, this function (and its nice documentation!) is part of the job and is
ready. So I can merge it, but it would just be good if you correct its name to
something like `gal_polygon_iscounterclockwise': it can return 1 if the
ordered set has a counterclockwise direction and 0 if it is clockwise. What do
you think? If you agree, make the corrections and I'll merge this part for
now.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/task/?15578>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [task #15578] Function to find if polygon vertices are sorted anti-clockwise, Sachin Kumar Singh, 2020/03/22
- [task #15578] Function to find if polygon vertices are sorted anti-clockwise, Mohammad Akhlaghi, 2020/03/22
- [task #15578] Function to find if polygon vertices are sorted anti-clockwise, Sachin Kumar Singh, 2020/03/23
- [task #15578] Function to find if polygon vertices are sorted anti-clockwise, Sachin Kumar Singh, 2020/03/23
- [task #15578] Function to find if polygon vertices are sorted anti-clockwise,
Mohammad Akhlaghi <=
- [task #15578] Function to find if polygon vertices are sorted anti-clockwise, Mohammad Akhlaghi, 2020/03/23
- [task #15578] Function to find if polygon vertices are sorted anti-clockwise, Sachin Kumar Singh, 2020/03/24
- Message not available
- [task #15578] Function to find if polygon vertices are sorted anti-clockwise, Sachin Kumar Singh, 2020/03/25
- [task #15578] Function to find if polygon vertices are sorted anti-clockwise, Mohammad Akhlaghi, 2020/03/25
- [task #15578] Function to find if polygon vertices are sorted anti-clockwise, Sachin Kumar Singh, 2020/03/25
- Message not available
- [task #15578] Function to find if polygon vertices are sorted anti-clockwise, Sachin Kumar Singh, 2020/03/26
- [task #15578] Function to find if polygon vertices are sorted anti-clockwise, Mohammad Akhlaghi, 2020/03/26
- [task #15578] Function to find if polygon vertices are sorted anti-clockwise, Sachin Kumar Singh, 2020/03/28
- [task #15578] Function to find if polygon vertices are sorted anti-clockwise, Sachin Kumar Singh, 2020/03/28
- [task #15578] Function to find if polygon vertices are sorted anti-clockwise, Mohammad Akhlaghi, 2020/03/28