dimforge / dimforge/nalgebra

Unit Quaternion logarithm inconsistent with exp

Open
#1,363 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
4.8k
Forks
565
PR merge metrics
No merged PRs in 30d

Description

Unit>::ln and Quaternion::ln differ, which is unexpected. Quaternion::ln seems to be correct and it is consistent with Quaternion::exp, at least on data I encountered.

```
[dependencies]
nalgebra = "0.32.3"
```

```
#[test]
fn quaternion_2() {
let p = UnitQuaternion::from_scaled_axis(Vector3::new(1., 2., 3.));
let q = p.into_inner();
assert!((q.ln().exp() - q).norm() < 1e-9); // OK - Quaternion::ln
assert!((p.ln().exp() - q).norm() < 1e-9); // fails - Unit>::ln
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the implementations of UnitQuaternion::ln and Quaternion::ln and compare their behavior with Quaternion::exp. Reproduce the provided quaternion_2 test using nalgebra 0.32.3, then verify that applying ln followed by exp to a UnitQuaternion matches the original quaternion within the stated tolerance.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.