manim.mobject.geometry.RegularPolygon

class RegularPolygon(n=6, start_angle=None, **kwargs)[source]

Bases: manim.mobject.geometry.Polygon

An n-sided regular polygon.

Parameters
  • n (int) – The number of sides of the polygon.

  • start_angle (Optional[float]) – The angle at which the polygon is rotated.

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

Examples

Example: RegularPolygonExample

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

class RegularPolygonExample(Scene):
    def construct(self):
        poly_1 = RegularPolygon(n=6)
        poly_2 = RegularPolygon(n=6, start_angle=30*DEGREES, color=GREEN)
        poly_3 = RegularPolygon(n=10, color=RED)

        poly_group = Group(poly_1, poly_2, poly_3).scale(1.5).arrange(buff=1)
        self.add(poly_group)

Methods

Attributes

animate

Used to animate the application of a method.

depth

The depth of the mobject.

height

The height of the mobject.

width

The width of the mobject.