dimforge / dimforge/nalgebra

Instable Matrix determinants (compared to numpy, online calculator)

Open
#1,325 18 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
4.8k
Forks
565
PR merge metrics
No merged PRs in 30d

Description

Hey all,
first of all thanks for the great linear algebra library for rust. It is really cool and great work.

Now to the problem I am facing.

I was calculating the determinant for this matrix (`Matrix5`):

```rust
┌ ┐
│ 6.8 8.9 5 150.45 1 │
│ 0 100000 -100000 20000000000 1 │
│ 2 8.7 3.9 94.89999999999998 1 │
│ 7.9 5.7 1.8 98.14 1 │
│ 7.9 5.7 1.8 98.14 1 │
└ ┘
```
which is giving me `det = 0.00002715771133219429`

In comparison `numpy` is returning `0.0`; a quick check with an online calculator also returned `0.0`.
I know this determinant should (in theory) be exactly zero, as (in this scenario) it checks whether a point lies `on`, `out` or `in` the circum-sphere of a terahedron. The example uses a point from the tetrhedron, so it is directly `on` the sphere.

Does someone have an idea why I am facing this level of floating point error?

( I found this for multiple determinant computations, above is one example.)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.