Commit b26fa1c
peng.li24
Add Rotation::from_euler + as_matrix, resolve issue 001
- scipy/transform.h: add as_matrix(T* m9) public method (quaternion→matrix)
Uses scipy's exact formulas: R[i,j] = f(x²,y²,z²,w²,xy,zw,...)
- scipy/transform.h: add from_euler(seq, angle) single-axis (std::sin/cos)
- scipy/transform.h: add from_euler(seq, angles[]) multi-axis with correct
extrinsic (lowercase, reversed compose) / intrinsic (uppercase) handling
matching scipy's _rotation.pyx Hamilton-product composition order
- pycpp/transform_py.h: add from_euler() Python wrapper that delegates to
scipy.Rotation.from_euler (numpy/SVML sin/cos → exact quaternion)
- pycpp/transform_py.h: add as_matrix() Python wrapper calling C++ arithmetic
with exact quaternion → 0-ULP full pipeline
- tests/test_all.py: TestFromEulerAsMatrix (38 tests, 960 assertions, all 0 ULP)
Key regression: from_euler(z, 5.837569e-06).as_matrix() → 0 ULP
Covers: near-zero yaw, all 6 extrinsic seqs ×100, intrinsic XYZ/ZYX ×100,
full roundtrip from_euler→as_matrix→from_matrix→as_euler
- issue/001: marked RESOLVED1 parent 7a9ce94 commit b26fa1c
5 files changed
Lines changed: 1251 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
54 | 64 | | |
55 | 65 | | |
56 | 66 | | |
| |||
84 | 94 | | |
85 | 95 | | |
86 | 96 | | |
87 | | - | |
| 97 | + | |
88 | 98 | | |
89 | 99 | | |
90 | 100 | | |
| |||
0 commit comments