You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I guess this is about floating point precision although all your values should be represented by IEEE754.
Use a comparison like return Math.Abs(area1-area2) < epsilon with a epsilon being a very small value
@mk1x86 I don't think so. Have a look at the output:
area1: 1.375
area2: -48.125
Also, since polygonArea(..) is deterministic, the same floating point error should occur in both cases so area1 and area2 would be the same (inaccurate) number.
Activity
mk1x86 commentedon Mar 25, 2015
I guess this is about floating point precision although all your values should be represented by IEEE754.
Use a comparison like return Math.Abs(area1-area2) < epsilon with a epsilon being a very small value
dermetfan commentedon Mar 25, 2015
@mk1x86 I don't think so. Have a look at the output:
area1: 1.375
area2: -48.125
Also, since
polygonArea(..)is deterministic, the same floating point error should occur in both cases so area1 and area2 would be the same (inaccurate) number.Merge pull request #2976 from dermetfan/patch-3
added GeometryUtils#arrangeConvexPolygon(..) (with test), fixed polyg…
added GeometryUtils#arrangeConvexPolygon(..) (with test), fixed polyg…