commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luc Maisonobe (JIRA)" <>
Subject [jira] [Created] (MATH-1093) arcs set split covers full circle instead of being empty
Date Fri, 24 Jan 2014 14:12:37 GMT
Luc Maisonobe created MATH-1093:

             Summary: arcs set split covers full circle instead of being empty
                 Key: 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:
    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);

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

View raw message