commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luc Maisonobe (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (MATH-554) Vector3D.crossProduct is sensitive to numerical cancellation
Date Sun, 03 Apr 2011 14:34:05 GMT

     [ https://issues.apache.org/jira/browse/MATH-554?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Luc Maisonobe resolved MATH-554.
--------------------------------

    Resolution: Fixed

fixed in subversion repository as of r1088316

> Vector3D.crossProduct is sensitive to numerical cancellation
> ------------------------------------------------------------
>
>                 Key: MATH-554
>                 URL: https://issues.apache.org/jira/browse/MATH-554
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.2
>         Environment: Linux, Sun JDK 1.5.0.22
>            Reporter: Luc Maisonobe
>            Assignee: Luc Maisonobe
>             Fix For: 3.0
>
>
> Cross product implementation uses the naive formulas (y1 z2 - y2 z1, ...). These formulas
fail when vectors are almost colinear, like in the following example:
> {code}
> Vector3D v1 = new Vector3D(9070467121.0, 4535233560.0, 1);
> Vector3D v2 = new Vector3D(9070467123.0, 4535233561.0, 1);
> System.out.println(Vector3D.crossProduct(v1, v2));
> {code}
> The previous code displays { -1, 2, 0 } instead of the correct answer { -1, 2, 1 }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message