------------------ Cycloidal Pendulum ------------------ .. image:: render.gif :width: 750px :align: center This example is about the motion of a `cycloidal pendulum `_, which demonstrates the isochrony may rise from suspending a pendulum on the cusp of an inverted cycloid. Animating the pendulum is done by computing its evolute for the curved component of the pendulum string and computing the trajectory normal to connect the mass and the curved component with a straight string. You can see download the full script at :download:`cycloidal_pendulum.py <../../../../examples/blender/geometry/cycloidal_pendulum.py>` . .. contents:: :local: :backlinks: none Helper Functions ================ We will mostly use helper functions to generate tangent edges, normal vertices, and envelope a which follows from the example :ref:`Envelope, Evolute, Orthogonal Trajectory and Involute of Curves`. An additional utility function used is `extend_evolute`, which extends the evolute to next vertices. .. literalinclude:: ../../../../examples/blender/geometry/cycloidal_pendulum.py :language: python :start-after: [helper-functions] :end-before: [helper-functions] Setup ===== .. literalinclude:: ../../../../examples/blender/geometry/cycloidal_pendulum.py :language: python :start-after: [setup] :end-before: [setup] Curve and Specified Helper Functions ==================================== We define the parametrization curve and sample the nets. Furthermore we create helper functions that generates traces of nets with different amplitudes. .. literalinclude:: ../../../../examples/blender/geometry/cycloidal_pendulum.py :language: python :start-after: [curve-and-functions] :end-before: [curve-and-functions] Visualization Setup =================== .. literalinclude:: ../../../../examples/blender/geometry/cycloidal_pendulum.py :language: python :start-after: [visualization-setup] :end-before: [visualization-setup] Animation Setup and Static Objects ================================== .. literalinclude:: ../../../../examples/blender/geometry/cycloidal_pendulum.py :language: python :start-after: [animation-setup] :end-before: [animation-setup] Main Animation Function ======================= .. literalinclude:: ../../../../examples/blender/geometry/cycloidal_pendulum.py :language: python :start-after: [animation-function] :end-before: [animation-function] Animation Callback and Keyframes ================================ .. literalinclude:: ../../../../examples/blender/geometry/cycloidal_pendulum.py :language: python :start-after: [animation-callback] :end-before: [animation-callback] Rendering Setup =============== .. literalinclude:: ../../../../examples/blender/geometry/cycloidal_pendulum.py :language: python :start-after: [rendering-setup] :end-before: [rendering-setup]