Circle¶
- class Circle(center: Point, radius: float, plane: PolarPlane, *args, **kwargs)[source]¶
A shape consisting of one closed loop of vertices that all have the same hyperbolic distance to a center point.
- Parameters:
center – A
hmanim.poincare.point.Point
representing the center of theCircle
.radius – A float representing the radius of the
Circle
.plane – The
PolarPlane
in which theCircle
lives.kwargs – Forwarded to the parent constructor.
Examples
Example: CircleExample ¶
from manim import * from hmanim.native import Circle, Point class CircleExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the circle. circle = Circle( center=Point(3.0, TAU / 8), radius=5.0, plane=plane ) self.add(circle)
from hmanim.native import Circle, Point class CircleExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the circle. circle = Circle( center=Point(3.0, TAU / 8), radius=5.0, plane=plane ) self.add(circle)
- property center: Point¶
The
hmanim.poincare.point.Point
representing the center of theCircle
.
- copy() Circle [source]¶
Create and return an identical copy of the
Mobject
including allsubmobjects
.- Returns:
The copy.
- Return type:
Mobject
Note
The clone is initially not visible in the Scene, even if the original was.
- get_native_render_anchors() list[Point] [source]¶
Determines the
hmanim.poincare.point.Point
objects on the path that represents the boundary of theCircle
.
- static get_render_angles(center: Point) list[float] [source]¶
Returns the angles of the points that are used to render the boundary of a circle. In particular, instead of distributing the angles uniformly, more fine-grained angles are placed towards the origin for smoother rendering.
- set_center(center: Point) Circle [source]¶
Change the center of the
Circle
.- Parameters:
center (hmanim.native.point.Point) – The new center of the
Circle
.- Returns:
The updated
Circle
.- Return type:
- set_center_of_projection(point: Point) Circle [source]¶
Change the center of projection of the
Circle
.- Parameters:
point (hmanim.native.point.Point) – The new center of projection of the
Circle
.- Returns:
The updated
Circle
.- Return type:
- class CircleRotate(mobject=None, *args, use_override=True, **kwargs)[source]¶
Rotate the
Circle
around the origin.Examples
Example: CircleRotateExample ¶
from manim import * from hmanim.native import Circle, CircleRotate, Point class CircleRotateExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the circle. circle = Circle( center=Point(5.0, 0.0), radius=5.0, plane=plane ) self.add(circle) # Rotate the circle self.play( CircleRotate( circle, TAU / 8 ) )
from hmanim.native import Circle, CircleRotate, Point class CircleRotateExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the circle. circle = Circle( center=Point(5.0, 0.0), radius=5.0, plane=plane ) self.add(circle) # Rotate the circle self.play( CircleRotate( circle, TAU / 8 ) )
- class CircleRotatedTranslate(mobject=None, *args, use_override=True, **kwargs)[source]¶
Similar to
CircleTranslate
but instead of translating along the x-axis, we translate along an axis that is rotated away from the x-axis by a given angle.Examples
Example: CircleRotatedTranslateExample ¶
from manim import * from hmanim.native import Circle, CircleRotatedTranslate, Point class CircleRotatedTranslateExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the circle. circle = Circle( center=Point(0.0, 0.0), radius=5.0, plane=plane ) self.add(circle) # Rotate the circle self.play( CircleRotatedTranslate( circle, distance=3, angle=TAU / 8 ) )
from hmanim.native import Circle, CircleRotatedTranslate, Point class CircleRotatedTranslateExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the circle. circle = Circle( center=Point(0.0, 0.0), radius=5.0, plane=plane ) self.add(circle) # Rotate the circle self.play( CircleRotatedTranslate( circle, distance=3, angle=TAU / 8 ) )
- interpolate_mobject(alpha: float)[source]¶
Interpolates the mobject of the
Animation
based on alpha value.- Parameters:
alpha – A float between 0 and 1 expressing the ratio to which the animation is completed. For example, alpha-values of 0, 0.5, and 1 correspond to the animation being completed 0%, 50%, and 100%, respectively.
- class CircleScale(mobject=None, *args, use_override=True, **kwargs)[source]¶
Scale the radius of a
Circle
by a given factor.Examples
Example: CircleScaleExample ¶
from manim import * from hmanim.native import Circle, CircleScale, Point class CircleScaleExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the circle. circle = Circle( center=Point(5.0, TAU / 8), radius=5.0, plane=plane ) self.add(circle) # Scale the circle radius by a factor of 1.5. self.play(CircleScale(circle, 1.5))
from hmanim.native import Circle, CircleScale, Point class CircleScaleExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the circle. circle = Circle( center=Point(5.0, TAU / 8), radius=5.0, plane=plane ) self.add(circle) # Scale the circle radius by a factor of 1.5. self.play(CircleScale(circle, 1.5))
- interpolate_mobject(alpha: float)[source]¶
Interpolates the mobject of the
Animation
based on alpha value.- Parameters:
alpha – A float between 0 and 1 expressing the ratio to which the animation is completed. For example, alpha-values of 0, 0.5, and 1 correspond to the animation being completed 0%, 50%, and 100%, respectively.
- class CircleTranslate(mobject=None, *args, use_override=True, **kwargs)[source]¶
Translate a
Circle
horizontally. The sign of the passed distance defines the direction of the translation.Examples
Example: CircleTranslateExample ¶
from manim import * from hmanim.native import Circle, CircleTranslate, Point class CircleTranslateExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the circle. circle = Circle( center=Point(5.0, 0.0), radius=5.0, plane=plane ) self.add(circle) # Translate the circle self.play( CircleTranslate( circle, distance=-3 ) )
from hmanim.native import Circle, CircleTranslate, Point class CircleTranslateExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the circle. circle = Circle( center=Point(5.0, 0.0), radius=5.0, plane=plane ) self.add(circle) # Translate the circle self.play( CircleTranslate( circle, distance=-3 ) )
- class CircleTranslateAndRotate(mobject=None, *args, use_override=True, **kwargs)[source]¶
Translate and simultaneously rotate a
Circle
.Examples
Example: CircleTranslateAndRotateExample ¶
from manim import * from hmanim.native import Circle, CircleTranslateAndRotate, Point class CircleTranslateAndRotateExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the circle. circle = Circle( center=Point(0.0, 0.0), radius=5.0, plane=plane ) self.add(circle) # Rotate the circle self.play( CircleTranslateAndRotate( circle, distance=3, angle=TAU / 4 ) )
from hmanim.native import Circle, CircleTranslateAndRotate, Point class CircleTranslateAndRotateExample(Scene): def construct(self): # The plane that all our hyperbolic objects live in. plane = PolarPlane(size=5) # Draw the circle. circle = Circle( center=Point(0.0, 0.0), radius=5.0, plane=plane ) self.add(circle) # Rotate the circle self.play( CircleTranslateAndRotate( circle, distance=3, angle=TAU / 4 ) )
- interpolate_mobject(alpha: float)[source]¶
Interpolates the mobject of the
Animation
based on alpha value.- Parameters:
alpha – A float between 0 and 1 expressing the ratio to which the animation is completed. For example, alpha-values of 0, 0.5, and 1 correspond to the animation being completed 0%, 50%, and 100%, respectively.