Set Curvature¶
- class SetCurvature(mobject: Mobject, curvature: float, run_time=3, apply_function_kwargs: Dict[str, Any] | None = None, **kwargs)[source]¶
An animation that changes the curvature of the hyperbolic plane that an object lives in.
Note
Only affects the object but not the other objects associated with the corresponding hyperbolic plane.
Examples
Example: SetCurvatureExample ¶
from manim import * from hmanim.native import Circle, Point, PolygonalChain, SetCurvature class SetCurvatureExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the polygon. chain = PolygonalChain( *[ Point(3.0, 0.0), Point(4.0, TAU / 4), Point(2.0, TAU / 2), Point(1.0, TAU * 3 / 4), ], plane=plane ) self.add(chain) # Draw the circle. circle = Circle( center=Point(3.0, 0.0), radius=5.0, plane=plane, ) self.add(circle) # Change the curvature target_curvature = -0.001 self.play( SetCurvature( chain, curvature=target_curvature, ), SetCurvature( circle, curvature=target_curvature, ) )
from hmanim.native import Circle, Point, PolygonalChain, SetCurvature class SetCurvatureExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the polygon. chain = PolygonalChain( *[ Point(3.0, 0.0), Point(4.0, TAU / 4), Point(2.0, TAU / 2), Point(1.0, TAU * 3 / 4), ], plane=plane ) self.add(chain) # Draw the circle. circle = Circle( center=Point(3.0, 0.0), radius=5.0, plane=plane, ) self.add(circle) # Change the curvature target_curvature = -0.001 self.play( SetCurvature( chain, curvature=target_curvature, ), SetCurvature( circle, curvature=target_curvature, ) )