Rotate¶
- class Rotate(mobject: VMobject, angle: float, run_time=3, apply_function_kwargs: Dict[str, Any] | None = None, **kwargs)[source]¶
An animation that rotates a
VMobject
around the origin by a given angle. In a sense, this is a wrapper class that automatically decides which rotation to apply to a given object, without having to specify whether it should be aCircleRotate
,DotRotate
,PolygonalChainRotate
,ClosedArcRotate
, etc.Examples
Example: RotateExample ¶
from manim import * from hmanim.native import Circle, Dot, Point, Rotate class RotateExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw a circle. center = Point(3.0, 0.0) circle = Circle( center=center, radius=5.0, plane=plane, ) self.add(circle) # Draw the circle center. dot = Dot(center, plane=plane) self.add(dot) # Rotate both the circle and the circle center. angle = TAU / 4 self.play( Rotate(circle, angle), Rotate(dot, angle), )
from hmanim.native import Circle, Dot, Point, Rotate class RotateExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw a circle. center = Point(3.0, 0.0) circle = Circle( center=center, radius=5.0, plane=plane, ) self.add(circle) # Draw the circle center. dot = Dot(center, plane=plane) self.add(dot) # Rotate both the circle and the circle center. angle = TAU / 4 self.play( Rotate(circle, angle), Rotate(dot, angle), )