From ef0ff526ef275b088550deddb3ccb582842369a4 Mon Sep 17 00:00:00 2001 From: GoThrones Date: Thu, 7 May 2026 01:42:27 +0530 Subject: [PATCH 1/4] add example showing difference between Rotate and Rotating --- manim/animation/rotation.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/manim/animation/rotation.py b/manim/animation/rotation.py index f47b0b6945..6c6ef99806 100644 --- a/manim/animation/rotation.py +++ b/manim/animation/rotation.py @@ -146,6 +146,28 @@ def construct(self): Rotate(Square(side_length=0.5), angle=2*PI, rate_func=linear), ) + + .. manim:: DifferenceBetweenRotateAndRotating + + class DifferenceBetweenRotateAndRotating(Scene): + def construct(self): + s = Square(color= GREEN) + scenter= s.get_center() + d = Dot(color = BLUE).move_to(s.get_corner(UP+RIGHT)) + s.add(d) + s.save_state() + self.add(TracedPath(d.get_center)) + #If no path_arc is given explicitly in the line below, + #then there is no difference in the output of Rotate and Rotating. + self.play(Rotate(s, angle=2*PI,rate_func =linear,path_arc = PI, run_time = 3, about_point=scenter)) + self.wait() + self.remove(*self.mobjects) + + s.restore() + self.add(TracedPath(d.get_center)) + self.play(Rotating(s, angle = 2*PI, rate_func = linear, about_point=scenter)) + self.wait() + See also -------- :class:`~.Rotating`, :meth:`~.Mobject.rotate` From 1ee31d7fbf9683ffd31147b0fe3fcbd473728dec Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 6 May 2026 20:20:47 +0000 Subject: [PATCH 2/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- manim/animation/rotation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manim/animation/rotation.py b/manim/animation/rotation.py index 6c6ef99806..fe02df751a 100644 --- a/manim/animation/rotation.py +++ b/manim/animation/rotation.py @@ -146,7 +146,7 @@ def construct(self): Rotate(Square(side_length=0.5), angle=2*PI, rate_func=linear), ) - + .. manim:: DifferenceBetweenRotateAndRotating class DifferenceBetweenRotateAndRotating(Scene): @@ -166,8 +166,8 @@ def construct(self): s.restore() self.add(TracedPath(d.get_center)) self.play(Rotating(s, angle = 2*PI, rate_func = linear, about_point=scenter)) - self.wait() - + self.wait() + See also -------- :class:`~.Rotating`, :meth:`~.Mobject.rotate` From 71545657619ba46c6b62616dfda44db54e2f77b1 Mon Sep 17 00:00:00 2001 From: GoThrones Date: Thu, 7 May 2026 02:29:48 +0530 Subject: [PATCH 3/4] modified the added example slightly --- manim/animation/rotation.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/manim/animation/rotation.py b/manim/animation/rotation.py index 6c6ef99806..2b1b2e46f0 100644 --- a/manim/animation/rotation.py +++ b/manim/animation/rotation.py @@ -154,19 +154,31 @@ def construct(self): s = Square(color= GREEN) scenter= s.get_center() d = Dot(color = BLUE).move_to(s.get_corner(UP+RIGHT)) + rotatelabel = Text("Rotate",color=PURE_YELLOW) s.add(d) s.save_state() - self.add(TracedPath(d.get_center)) + s.add(rotatelabel) + + self.add(TracedPath(d.get_center,stroke_width = 3,stroke_color=PURE_YELLOW)) #If no path_arc is given explicitly in the line below, #then there is no difference in the output of Rotate and Rotating. + self.add(Text("Path Arc is PI",color = PURE_YELLOW).scale(0.8).shift(2*DOWN)) self.play(Rotate(s, angle=2*PI,rate_func =linear,path_arc = PI, run_time = 3, about_point=scenter)) self.wait() self.remove(*self.mobjects) + self.add(TracedPath(d.get_center,stroke_width = 3,stroke_color=PURE_YELLOW)) + self.add(Text("Path Arc is None",color = PURE_YELLOW).scale(0.8).shift(2*DOWN)) + self.play(Rotate(s, angle=2*PI,rate_func =linear, run_time = 3, about_point=scenter)) + self.wait() + self.remove(*self.mobjects) + s.restore() - self.add(TracedPath(d.get_center)) - self.play(Rotating(s, angle = 2*PI, rate_func = linear, about_point=scenter)) - self.wait() + rotatinglabel = Text("Rotating",color=ORANGE).scale_to_fit_width(s.get_width()) + s.add(rotatinglabel) + self.add(TracedPath(d.get_center,stroke_width = 3,stroke_color=ORANGE)) + self.play(Rotating(s, angle = 2*PI, rate_func = linear, about_point=scenter,run_time = 3)) + self.wait() See also -------- From fb918b771ba11c2660f09a403b037235e88782a0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 6 May 2026 21:01:13 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- manim/animation/rotation.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/manim/animation/rotation.py b/manim/animation/rotation.py index fc62db0b00..b221051099 100644 --- a/manim/animation/rotation.py +++ b/manim/animation/rotation.py @@ -157,8 +157,8 @@ def construct(self): rotatelabel = Text("Rotate",color=PURE_YELLOW) s.add(d) s.save_state() - s.add(rotatelabel) - + s.add(rotatelabel) + self.add(TracedPath(d.get_center,stroke_width = 3,stroke_color=PURE_YELLOW)) #If no path_arc is given explicitly in the line below, #then there is no difference in the output of Rotate and Rotating. @@ -172,14 +172,14 @@ def construct(self): self.play(Rotate(s, angle=2*PI,rate_func =linear, run_time = 3, about_point=scenter)) self.wait() self.remove(*self.mobjects) - + s.restore() rotatinglabel = Text("Rotating",color=ORANGE).scale_to_fit_width(s.get_width()) s.add(rotatinglabel) self.add(TracedPath(d.get_center,stroke_width = 3,stroke_color=ORANGE)) self.play(Rotating(s, angle = 2*PI, rate_func = linear, about_point=scenter,run_time = 3)) - self.wait() - + self.wait() + See also -------- :class:`~.Rotating`, :meth:`~.Mobject.rotate`