Commit cdcc9d8
committed
Suggestions from reviewers
- makes axes3d.Quaternion a private _Quaternion class
- shortens as_cardan_angles()
- adds two extra tests to test_axes3d::test_quaternion(): from_cardan_angles() should return a unit quaternion, and as_cardan_angles() should be insensitive to quaternion magnitude
- updates "mplot3d View Angles" documentation (the mouse can control both azimuth, elevation, and roll; and matlab does have a roll angle nowadays)
- put in a reference to quaternion multiplication using scalar and vector parts (wikipedia)
- rename class method that constructs a quaternion from two vectors to `rotate_from_to()`
- clarify docstring: "The quaternion for the shortest rotation from vector r1 to vector r2"
- issue warning when vectors are anti-parallel: "shortest rotation is ambiguous"
- construct a perpendicular vector for generic r2 == -r1
- add test case for anti-parallel vectors
- add test for the warning
- add reference to Ken Shoemake's arcball, in axes3d.py
- point out that angles are in radians, not degrees, in quaternion class docstrings
- in test_axes3d, add an import for axes3d._Quaternion, to avoid repetition
- add Quaternion conjugate(), and tests for it
- add Quaternion norm, and tests
- add Quaternion normalize(), and tests
- add Quaternion reciprocal(), and tests
- add Quaternion division, and tests
- add Quaternion rotate(vector), and a test1 parent ad26517 commit cdcc9d8
1 file changed
+3
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | | - | |
25 | | - | |
| 23 | + | |
| 24 | + | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
0 commit comments