Code Monkey home page Code Monkey logo

Comments (5)

Ralith avatar Ralith commented on May 28, 2024 1

As an occasional user of this method I'd appreciate a guaranteed-stable variant, and shuffling the names around makes sense. The iterative version should have a scarier name to indicate it's fallible, though. Maybe also take a max iteration count and return Option so it's possible to use safely?

from nalgebra.

alvinz-matician avatar alvinz-matician commented on May 28, 2024

I have been able to reproduce this.

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=828c7f0da360ba36aed2062aa65c90f0

from nalgebra.

Andlon avatar Andlon commented on May 28, 2024

Related: #627, #1187.

from nalgebra.

Andlon avatar Andlon commented on May 28, 2024

So we've had plenty of problems with these construction methods. The crux of the issue, in my opinion, is that they rely on an iterative algorithm with - to my understanding - no guaranteed convergence (don't get fooled by the paper title containing the word "Robust", it is very loosely used).

I think a method with the name from_matrix should use a provably reliable method. We can have a separate method for a faster iterative variant which users can opt in to. I also think that from_matrix is not a good name in the first place, because it's not "just" a "from conversion": it attempts to find the closest rotation to the given matrix. I'd suggest something like the following:

  • Introduce a method closest_rotation_to_matrix which uses a rotationally proper Polar decomposition or similar to guarantee a robust result (barring problems with our SVD ...).
  • Deprecate from_matrix and from_matrix_eps, and instead move the functionality here to separate methods closest_rotation_to_matrix_iterative or something like that.

I didn't think too much about names here. I also don't have a personal stake in this problem so I might have missed some important considerations apparent to users who are running into the problem. A 5 minute literature study turned up this recent paper which upon a cursory scan seems to feature a decent discussion of the problem:

Sarabandi et al., On Closed-Form Formulas for the 3-D Nearest Rotation Matrix Problem

from nalgebra.

Andlon avatar Andlon commented on May 28, 2024

There's some more in-depth discussion of the current implementation in this merged PR from earlier this year: #1101.

from nalgebra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.