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:
MultiPendulumA 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
animateUsed to animate the application of any method of
self.animation_overridescolordepthThe depth of the mobject.
fill_colorIf there are multiple colors (for gradient) this returns the first one
heightThe height of the mobject.
n_points_per_curvesheen_factorstroke_colorwidthThe width of the mobject.