MCPcopy
hub / github.com/ManimCommunity/manim / Circle

Class Circle

manim/mobject/geometry/arc.py:619–771  ·  view source on GitHub ↗

A circle. Parameters ---------- color The color of the shape. kwargs Additional arguments to be passed to :class:`Arc` Examples -------- .. manim:: CircleExample :save_last_frame: class CircleExample(Scene): def construct(sel

Source from the content-addressed store, hash-verified

617
618
619class Circle(Arc):
620 """A circle.
621
622 Parameters
623 ----------
624 color
625 The color of the shape.
626 kwargs
627 Additional arguments to be passed to :class:`Arc`
628
629 Examples
630 --------
631 .. manim:: CircleExample
632 :save_last_frame:
633
634 class CircleExample(Scene):
635 def construct(self):
636 circle_1 = Circle(radius=1.0)
637 circle_2 = Circle(radius=1.5, color=GREEN)
638 circle_3 = Circle(radius=1.0, color=BLUE_B, fill_opacity=1)
639
640 circle_group = Group(circle_1, circle_2, circle_3).arrange(buff=1)
641 self.add(circle_group)
642 """
643
644 def __init__(
645 self,
646 radius: float | None = None,
647 color: ParsableManimColor = RED,
648 **kwargs: Any,
649 ) -> None:
650 super().__init__(
651 radius=radius,
652 start_angle=0,
653 angle=TAU,
654 color=color,
655 **kwargs,
656 )
657
658 def surround(
659 self,
660 mobject: Mobject,
661 dim_to_match: int = 0,
662 stretch: bool = False,
663 buffer_factor: float = 1.2,
664 ) -> Self:
665 """Modifies a circle so that it surrounds a given mobject.
666
667 Parameters
668 ----------
669 mobject
670 The mobject that the circle will be surrounding.
671 dim_to_match
672 buffer_factor
673 Scales the circle with respect to the mobject. A `buffer_factor` < 1 makes the circle smaller than the mobject.
674 stretch
675 Stretches the circle to fit more tightly around the mobject. Note: Does not work with :class:`Line`
676

Calls

no outgoing calls