Square

Qualified name: manim.mobject.geometry.Square

class Square(side_length=2.0, **kwargs)[source]

Bases: manim.mobject.geometry.Rectangle

A rectangle with equal side lengths.

Parameters
  • side_length (float, optional) – The length of the sides of the square.

  • kwargs (Any) – Additional arguments to be passed to Square

Examples

Example: SquareExample

../_images/SquareExample-1.png
from manim import *

class SquareExample(Scene):
    def construct(self):
        square_1 = Square(side_length=2.0).shift(DOWN)
        square_2 = Square(side_length=1.0).next_to(square_1, direction=UP)
        square_3 = Square(side_length=0.5).next_to(square_2, direction=UP)
        self.add(square_1, square_2, square_3)

Methods

Attributes

animate

Used to animate the application of a method.

animation_overrides

depth

The depth of the mobject.

height

The height of the mobject.

width

The width of the mobject.