.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/chaos/interactive_and_animation/plot_plotly_trajectory.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_api_gallery_chaos_interactive_and_animation_plot_plotly_trajectory.py: Interactive Plotly Figures ============================ Alongside the Matplotlib helpers, :mod:`physicskit.chaos.visualizers.dynamic_plots` provides interactive `Plotly `_ figures: a trajectory you can pan and zoom, and an interactive Poincare section you can hover over to inspect individual bounce points. The billiard used here is the Sinai billiard: a square cell, :math:`|x|\le L/2,\ |y|\le L/2`, with a circular scatterer of radius :math:`r_s` removed from its center, :math:`x^2+y^2=r_s^2`, off of which the particle undergoes specular reflection, :math:`\mathbf{v}' = \mathbf{v} - 2(\mathbf{v}\cdot\mathbf{n}) \,\mathbf{n}`, whenever it strikes the boundary. .. GENERATED FROM PYTHON SOURCE LINES 15-21 .. code-block:: Python from physicskit.chaos.systems.billiards import SinaiBilliard from physicskit.chaos.visualizers.dynamic_plots import plotly_billiard_trajectory, plotly_poincare_section billiard = SinaiBilliard(cell_size=2.0, scatterer_radius=0.5) .. GENERATED FROM PYTHON SOURCE LINES 22-24 Trajectory ---------- .. GENERATED FROM PYTHON SOURCE LINES 24-27 .. code-block:: Python fig_traj = plotly_billiard_trajectory(billiard, pos=billiard.sample_interior_point(), vel=(0.4, 0.9), n_bounces=150) fig_traj.show() .. GENERATED FROM PYTHON SOURCE LINES 28-30 Poincare section ----------------- .. GENERATED FROM PYTHON SOURCE LINES 30-32 .. code-block:: Python fig_poincare = plotly_poincare_section(billiard, n_rays=40, n_bounces=200, seed=0) fig_poincare.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.499 seconds) .. _sphx_glr_download_api_gallery_chaos_interactive_and_animation_plot_plotly_trajectory.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_plotly_trajectory.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_plotly_trajectory.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_plotly_trajectory.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_