Pendulum#

Qualified name: manim\_physics.rigid\_mechanics.pendulum.Pendulum

class Pendulum(length=3.5, initial_theta=0.3, pivot_point=array([0., 2., 0.]), rod_style={}, bob_style={'color': ManimColor('#FF862F'), 'fill_opacity': 1, 'radius': 0.25}, **kwargs)[source]#

Bases: MultiPendulum

A pendulum.

Parameters:
  • length – The length of the pendulum.

  • initial_theta – The initial angle of deviation.

  • rod_style – Parameters for Line.

  • bob_style – Parameters for Circle.

  • kwargs – Additional parameters for VGroup.

Examples

Example: PendulumExample

from manim import *

from manim_physics import *
class PendulumExample(SpaceScene):
    def construct(self):
        pends = VGroup(*[Pendulum(i) for i in np.linspace(1, 5, 7)])
        self.add(pends)
        for p in pends:
            self.make_rigid_body(*p.bobs)
            p.start_swinging()
        self.wait(10)
from manim_physics import *
class PendulumExample(SpaceScene):
    def construct(self):
        pends = VGroup(*[Pendulum(i) for i in np.linspace(1, 5, 7)])
        self.add(pends)
        for p in pends:
            self.make_rigid_body(*p.bobs)
            p.start_swinging()
        self.wait(10)

Methods

Attributes

animate

Used to animate the application of any method of self.

animation_overrides

color

depth

The depth of the mobject.

fill_color

If there are multiple colors (for gradient) this returns the first one

height

The height of the mobject.

n_points_per_curve

sheen_factor

stroke_color

width

The width of the mobject.