BoundingOrientedBox::CreateFromPoints solver suffers from numeric problems

Open
#13 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp

Research direction

Start at BoundingOrientedBox::CreateFromPoints and its SolveCubic helper, then reproduce the reported precision problem on real-valued symmetric 3x3 matrices. Compare the current cubic-solver behavior with the issue's suggested preconditioning or specialized iterative method; done means all three eigenvalues are computed robustly despite float precision.

Written by the indexing model from the issue text.

Description

bug

Report from Dave Eberly about problems with the oriented box SolveCubic helper function.

The SolveCubic is called to compute the eigenvalues of a real-valued symmetric 3x3 matrix. Such matrices ALWAYS have 3 real eigenvalues, so SolveCubic is returning a theoretically incorrect result. The problem has to do with the precision of 'float' numbers. The cubic-solver approach can be made more robust by preconditioning the matrix.

Root finding using the closed-form algebraic equations for low-degree polynomials is known to be numerically ill conditioned. It is better to use iterative methods. For 3x3 symmetric matrices, a specialized iterative method can be very fast, extremely accurate, and robust.

Dominant language
C++
Stars
1.8k
Forks
262
Avg merge
3d 12h
Merged PRs (30d)
5

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/DirectXMath

All issues in microsoft/DirectXMath

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.