@@ -60,6 +60,7 @@ class Transform(Animation):
6060 path_arc
6161 The arc angle (in radians) that the points of ``mobject`` will follow to reach
6262 the points of the target if using a circular path arc, see ``path_arc_centers``.
63+ See also :func:`manim.utils.paths.path_along_arc`.
6364 path_arc_axis
6465 The axis to rotate along if using a circular path arc, see ``path_arc_centers``.
6566 path_arc_centers
@@ -74,6 +75,47 @@ class Transform(Animation):
7475
7576 If set to True, ``mobject`` will be removed from the scene and ``target_mobject`` will
7677 replace it. Otherwise, ``target_mobject`` is never added and ``mobject`` just takes its shape.
78+
79+ Examples
80+ --------
81+
82+ .. manim :: TransformPathArc
83+
84+ class TransformPathArc(Scene):
85+ def construct(self):
86+ def make_arc_path(start, end, arc_angle):
87+ points = []
88+ p_fn = path_along_arc(arc_angle)
89+ # alpha animates between 0.0 and 1.0, where 0.0
90+ # is the beginning of the animation and 1.0 is the end.
91+ for alpha in range(0, 11):
92+ points.append(p_fn(start, end, alpha / 10.0))
93+ path = VMobject(stroke_color=YELLOW)
94+ path.set_points_smoothly(points)
95+ return path
96+
97+ left = Circle(stroke_color=BLUE_E, fill_opacity=1.0, radius=0.5).move_to(LEFT * 2)
98+ colors = [TEAL_A, TEAL_B, TEAL_C, TEAL_D, TEAL_E, GREEN_A]
99+ # Positive angles move counter-clockwise, negative angles move clockwise.
100+ examples = [-90, 0, 30, 90, 180, 270]
101+ anims = []
102+ for idx, angle in enumerate(examples):
103+ left_c = left.copy().shift((3 - idx) * UP)
104+ left_c.fill_color = colors[idx]
105+ right_c = left_c.copy().shift(4 * RIGHT)
106+ path_arc = make_arc_path(left_c.get_center(), right_c.get_center(),
107+ arc_angle=angle * DEGREES)
108+ desc = Text('%d°' % examples[idx]).next_to(left_c, LEFT)
109+ # Make the circles in front of the text in front of the arcs.
110+ self.add(
111+ path_arc.set_z_index(1),
112+ desc.set_z_index(2),
113+ left_c.set_z_index(3),
114+ )
115+ anims.append(Transform(left_c, right_c, path_arc=angle * DEGREES))
116+
117+ self.play(*anims, run_time=2)
118+ self.wait()
77119 """
78120
79121 def __init__ (
0 commit comments