[ 
https://issues.apache.org/jira/browse/MATH-938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13593529#comment-13593529
 ] 

Evan Ward commented on MATH-938:
--------------------------------

Test Case:

{noformat} 
    @Test
    public void testRevert() {
        // setup
        Line line = new Line(new Vector3D(1653345.6696423641,
                6170370.041579291, 90000), new Vector3D(1650757.5050732433,
                6160710.879908984, 0.9));
        Vector3D expected = line.getDirection().negate();

        // action
        Line reverted = line.revert();

        // verify
        assertArrayEquals(expected.toArray(),
                reverted.getDirection().toArray(), 0);
    }
{noformat}
                
> Line.revert() is imprecise
> --------------------------
>
>                 Key: MATH-938
>                 URL: https://issues.apache.org/jira/browse/MATH-938
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.2
>            Reporter: Evan Ward
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> Line.revert() only maintains ~10 digits for the direction. This becomes an 
> issue when the line's position is evaluated far from the origin. A simple fix 
> would be to use Vector3D.negate() for the direction.
> Also, is there a reason why Line is not immutable? It is just comprised of 
> two vectors.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to