You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Luc Maisonobe (JIRA)" <ji...@apache.org> on 2014/01/24 15:12:37 UTC
[jira] [Created] (MATH-1093) arcs set split covers full circle
instead of being empty
Luc Maisonobe created MATH-1093:
-----------------------------------
Summary: arcs set split covers full circle instead of being empty
Key: MATH-1093
URL: https://issues.apache.org/jira/browse/MATH-1093
Project: Commons Math
Issue Type: Bug
Affects Versions: 3.3
Reporter: Luc Maisonobe
When splitting an arcs set using an arc very close to one of the boundaries (but not at the boundary), the algorithm confuses cases for which end - start = 2pi from cases for which end - start = epsilon.
The following test case shows such a failure:
{code}
@Test
public void testSplitWithinEpsilon() {
double epsilon = 1.0e-10;
double a = 6.25;
double b = a - 0.5 * epsilon;
ArcsSet set = new ArcsSet(a - 1, a, epsilon);
Arc arc = new Arc(b, b + FastMath.PI, epsilon);
ArcsSet.Split split = set.split(arc);
Assert.assertEquals(set.getSize(), split.getPlus().getSize(), epsilon);
Assert.assertNull(split.getMinus());
}
{code}
The last assertion (split.getMinus() being null) fails, as with current code split.getMinus() covers the full circle from 0 to 2pi.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)