Core Objects
- - Circle, Square, Rectangle, Line, Arrow, Dot, Polygon, RegularPolygon
- - Text, Tex, MathTex
- - ImageMobject, SVGMobject
- - Group and VGroup
Runnable examples for the currently supported feature set. Previews are lazy and only compile when you click Render preview, so opening this page does not trigger a flood of compile requests.
Animate property setters and transforms.
scene = Scene(fps=30, width=640, height=360)square = Square().set_fill(RED, opacity=1.0)scene.add(square)scene.play(square.animate.set_fill(WHITE), run_time=1)scene.play(square.animate.shift(UP).rotate(PI / 3), run_time=1.5)scene.wait(1)
Core Animation examples.
scene = Scene(fps=30, width=640, height=360)square = Square()scene.play(FadeIn(square))scene.play(Rotate(square, PI / 4))scene.play(FadeOut(square))scene.wait(1)
Three shapes move with a small lag.
scene = Scene(fps=30, width=640, height=360)circle = Circle().shift(LEFT * 2)square = Square().shift(ORIGIN)triangle = Triangle().shift(RIGHT * 2)scene.add(circle, square, triangle)scene.play( LaggedStart( circle.animate.shift(UP * 1.5), square.animate.shift(DOWN * 1.0), triangle.animate.shift(UP * 1.5), lag_ratio=0.2 ), run_time=2, rate_func=there_and_back)scene.wait(0.5)
Two objects move at the same time with lag_ratio=0.
scene = Scene(fps=30, width=640, height=360)car = Dot(point=LEFT * 4 + UP * 1, color=RED)bus = Dot(point=LEFT * 4 + DOWN * 1, color=BLUE)scene.add(car, bus) car_end_pos = RIGHT * 4 + UP * 1gpu_end_pos_latency = LEFT * 0.5 + DOWN * 1bus_latency_time = 3 scene.play( AnimationGroup( car.animate.move_to(car_end_pos), bus.animate.move_to(gpu_end_pos_latency), lag_ratio=0 ), run_time=bus_latency_time, rate_func=linear)scene.wait(0.5)