Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cdcc9d8

Browse files
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 test
1 parent ad26517 commit cdcc9d8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

doc/api/toolkits/mplot3d/view_angles.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,16 @@ The position of the viewport "camera" in a 3D plot is defined by three angles:
1212
points towards the center of the plot box volume. The angle direction is a
1313
common convention, and is shared with
1414
`PyVista <https://docs.pyvista.org/api/core/camera.html>`_ and
15-
`MATLAB <https://www.mathworks.com/help/matlab/ref/view.html>`_
16-
(though MATLAB lacks a roll angle). Note that a positive roll angle rotates the
15+
`MATLAB <https://www.mathworks.com/help/matlab/ref/view.html>`_. Note that a positive roll angle rotates the
1716
viewing plane clockwise, so the 3d axes will appear to rotate
1817
counter-clockwise.
1918

2019
.. image:: /_static/mplot3d_view_angles.png
2120
:align: center
2221
:scale: 50
2322

24-
Rotating the plot using the mouse will control only the azimuth and elevation,
25-
but all three angles can be set programmatically::
23+
Rotating the plot using the mouse will control azimuth, elevation,
24+
as well as roll, and all three angles can be set programmatically::
2625

2726
import matplotlib.pyplot as plt
2827
ax = plt.figure().add_subplot(projection='3d')

0 commit comments

Comments
 (0)