Circle
(color='#FC6255', close_new_points=True, anchors_span_full_range=False, **kwargs)[source]¶Bases: manim.mobject.geometry.Arc
A circle.
Examples
class CircleExample(Scene):
def construct(self):
circle_1 = Circle(radius=1.0)
circle_2 = Circle(radius=1.5, color=GREEN)
circle_3 = Circle(radius=1.0, color=BLUE_B, fill_opacity=1)
circle_group = Group(circle_1, circle_2, circle_3).arrange(buff=1)
self.add(circle_group)
Methods
Returns the position of a point on the circle. |
|
Modifies a circle so that it surrounds a given mobject. |
Attributes
|
Used to animate the application of a method. |
|
The depth of the mobject. |
|
The height of the mobject. |
|
The width of the mobject. |
point_at_angle
(angle)[source]¶Returns the position of a point on the circle.
angle (class: float) – The angle of the point along the circle in radians.
Examples
class PointAtAngleExample(Scene):
def construct(self):
circle = Circle(radius=2.0)
p1 = circle.point_at_angle(PI/2)
p2 = circle.point_at_angle(270*DEGREES)
s1 = Square(side_length=0.25).move_to(p1)
s2 = Square(side_length=0.25).move_to(p2)
self.add(circle, s1, s2)
The location of the point along the circle’s circumference.
numpy.ndarray
surround
(mobject, dim_to_match=0, stretch=False, buffer_factor=1.2)[source]¶Modifies a circle so that it surrounds a given mobject.
mobject (Mobject
) – The mobject that the circle will be surrounding.
dim_to_match (int
, optional) –
buffer_factor (float
, optional) – Scales the circle with respect to the mobject. A buffer_factor < 1 makes the circle smaller than the mobject.
stretch (bool
, optional) – Stretches the circle to fit more tightly around the mobject. Note: Does not work with Line
Examples
class CircleSurround(Scene):
def construct(self):
triangle1 = Triangle()
circle1 = Circle().surround(triangle1)
group1 = Group(triangle1,circle1) # treat the two mobjects as one
line2 = Line()
circle2 = Circle().surround(line2, buffer_factor=2.0)
group2 = Group(line2,circle2)
# buffer_factor < 1, so the circle is smaller than the square
square3 = Square()
circle3 = Circle().surround(square3, buffer_factor=0.5)
group3 = Group(square3, circle3)
group = Group(group1, group2, group3).arrange(buff=1)
self.add(group)