bugGNU Octave - Bugs: bug #40970, inpolygon incompatibility (Octave...

 
 

bug #40970: inpolygon incompatibility (Octave and Matlab disagrees about points on edges)

Submitted by:  None
Submitted on:  Thu 19 Dec 2013 11:37:57 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: Anders A. SøndergaardOriginator Email: -unavailable-
Open/Closed: ClosedRelease: dev
Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 26 Apr 2015 03:51:44 AM UTC, comment #3:

This was a pretty easy fix. I just included the points that were also on the boundary using

See http://hg.savannah.gnu.org/hgweb/octave/rev/bef9086a6725.

Closing report.

Rik <rik5>
Project Administrator
Mon 29 Dec 2014 04:12:09 AM UTC, comment #2:

inpolygon is written as an m-file which makes it very easy to modify. If a patch is submitted I can review it. Since Octave calculates both in polygon and on polygon values already the brain dead solution would be to just return

Rik <rik5>
Project Administrator
Thu 19 Dec 2013 12:59:23 PM UTC, comment #1:

Confirmed on the latest development version as well. And Mathworks help page does say "inside the polygonal region or on the polygon boundary".

Mike Miller <mtmiller>
Project Administrator
Thu 19 Dec 2013 11:37:57 AM UTC, original submission:

The inpolygon function in Matlab returns 1 if a point is inside
a polygon _or on the edge of it_.

In Octave, inpolygon only returns 1 if the point is strictly inside the polygon, and 0 if it is on the edge.

The following function demonstrates the incompatibility

When called from matlab, the result is
When called from Octave:

Anders Søndergaard

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 26 Apr 2015 03:51:44 AM UTCrik5StatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Thu 19 Dec 2013 12:59:23 PM UTCmtmillerCategoryLibraries=>Octave Function
      StatusNone=>Confirmed
      Release3.6.4=>dev
      Operating SystemGNU/Linux=>Any

    Back to the top


    Powered by Savane 3.1-cleanup1