antonioiacobucci / poly2tri

Automatically exported from code.google.com/p/poly2tri
Other
0 stars 0 forks source link

p2t::Point inequility operator is wrong #38

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In the current version (from repository), the != operator is written as follows 
(line 267 in common/shapes.h):

inline bool operator !=(const Point& a, const Point& b)
{
  return a.x != b.x && a.y != b.y;
}

It's not very consistent with the behaviour of == operator:

inline bool operator ==(const Point& a, const Point& b)
{
  return a.x == b.x && a.y == b.y;
}

The inequility should be !(a == b).

Original issue reported on code.google.com by e...@multitou.ch on 13 Jan 2012 at 1:27

GoogleCodeExporter commented 8 years ago
a.x != b.x || a.y != b.y maybe?

Original comment by makc.the...@gmail.com on 13 Feb 2012 at 3:45

GoogleCodeExporter commented 8 years ago
Is there a problem with the algorithm returning incorrect results?

Original comment by mason.gr...@gmail.com on 4 Apr 2012 at 1:20

GoogleCodeExporter commented 8 years ago
I don't think the operator is used at all by the library, so no. I just noticed 
the error when I wrote some tests myself and used the operator.

Original comment by e...@multitou.ch on 4 Apr 2012 at 4:10

GoogleCodeExporter commented 8 years ago

Original comment by mason.gr...@gmail.com on 2 May 2013 at 1:41