Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Added an example to :class:`~.ArcBetweenPoints` (#1650)

PipedQuintes1e01feb70dcc
diff --git a/manim/mobject/geometry.py b/manim/mobject/geometry.py
index 87d39b3ee..65b22057d 100644
--- a/manim/mobject/geometry.py
+++ b/manim/mobject/geometry.py
@@ -395,6 +395,21 @@ class Arc(TipableVMobject):
class ArcBetweenPoints(Arc):
"""
Inherits from Arc and additionally takes 2 points between which the arc is spanned.
+
+ Example
+ --------------------
+ .. manim:: ArcBetweenPointsExample
+
+ class ArcBetweenPointsExample(Scene):
+ def construct(self):
+ circle = Circle(radius=2, stroke_color=GREY)
+ dot_1 = Dot(color=GREEN).move_to([2, 0, 0]).scale(0.5)
+ dot_1_text = Tex("(2,0)").scale(0.5).next_to(dot_1, RIGHT).set_color(BLUE)
+ dot_2 = Dot(color=GREEN).move_to([0, 2, 0]).scale(0.5)
+ dot_2_text = Tex("(0,2)").scale(0.5).next_to(dot_2, UP).set_color(BLUE)
+ arc= ArcBetweenPoints(start=2 * RIGHT, end=2 * UP, stroke_color=YELLOW)
+ self.add(circle, dot_1, dot_2, dot_1_text, dot_2_text)
+ self.play(Create(arc))
"""
def __init__(self, start, end, angle=TAU / 4, radius=None, **kwargs):