.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples_tutorials/example_rotating.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_tutorials_example_rotating.py: ================================================================================ Create a rotating element ================================================================================ Create a rotating element. .. GENERATED FROM PYTHON SOURCE LINES 9-30 .. image-sg:: /auto_examples_tutorials/images/sphx_glr_example_rotating_001.png :alt: example rotating :srcset: /auto_examples_tutorials/images/sphx_glr_example_rotating_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none 0.0 [ 0.19634954 1.4529866 2.70962366 -2.31692458 -1.06028752] 1.0 [ 0.32724923 1.5838863 2.84052336 -2.18602489 -0.92938783] 2.0 [ 0.45814893 1.71478599 2.97142305 -2.05512519 -0.79848813] | .. code-block:: default from math import pi import matplotlib.pyplot as plt import freshkiss3d as fk element = fk.Rotating(angles_number = 5, angular_velocity = 2*pi/48., phase = 2.*pi/32.) for time in [0., 1., 2.]: element.rotates(time) print(time, element.angles) element.plot() plt.legend() plt.axis('scaled') plt.xlim(-1.2, 1.2) plt.ylim(-1.2, 1.2) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.111 seconds) .. _sphx_glr_download_auto_examples_tutorials_example_rotating.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: example_rotating.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: example_rotating.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_