Open khallock opened 5 years ago
A slight variation ..... If the following is done
lats = (/ 15, 40, 0, -30, -30 /)
lats = lats + 30
Both return False!
I am using NCL 6.3.0 on recent versions of both Mac OS and Linux. gc_clkwise returns the wrong value for this simple clockwise polygon:
ncl 1> lats=(/8,15,5,0/)
ncl 2> lons=(/38,130,130,38/)
ncl 3> print (gc_clkwise(lats,lons))
(0) False
However, the correct value is returned for the same polygon, with the order of coordinates simply rotated by one position:
ncl 4> lats=(/0,8,15,5/)
ncl 5> lons=(/38,38,130,130/)
ncl 6> print (gc_clkwise(lats,lons))
(0) True
This may be related to a similar gc_clkwise problem that was assigned to JIRA NCL-1699. Please add this case to that ticket. Thank you.
The following demonstrates two large simple polygons over the Pacific ocean. Both are written in clockwise order, yet the function gc_clkwise returns the wrong value for the first polygon.
I believe that both polygons conform to the documented constraint that each must be containted in a hemisphere. We get the same behavior with NCL 6.0.0 and 6.1.2 on Mac OS 10.8.3, 64-bit x86 CPU. Am I mistaken, or is this a bug in the function? Thanks for looking into this.