Closed Arc

class ClosedArc(center: Point, radius: float, start_angle: float, angle: float, plane: PolarPlane, *args, **kwargs)[source]

A circular arc whose endpoints are connected by a geodesic line segment.

Parameters:
  • center – A hmanim.poincare.point.Point representing the center of the circle that the ClosedArc lives on.

  • radius – A float representing the radius of the circle that the Arc lives on.

  • start_angle – A float representing the angle at which the closed arc starts. The angle is measured in radians and is measured counterclockwise from the positive x-axis.

  • angle – A float representing the angular width of the closed arc, i.e., how far it extends from the start_angle.

  • plane – The PolarPlane in which the ClosedArc lives.

Examples

Example: ClosedArcExample

../_images/ClosedArcExample-1.png
from manim import *

from hmanim.native import ClosedArc, Point

class ClosedArcExample(Scene):
    def construct(self):
        # The plane that all our hyperbolic objects live in.
        plane = PolarPlane(size=5)

        # Draw the closed arc.
        arc = ClosedArc(
            center=Point(),
            radius=5.0,
            start_angle=0.0,
            angle=TAU / 8,
            plane=plane
        )
        self.add(arc)
from hmanim.native import ClosedArc, Point

class ClosedArcExample(Scene):
    def construct(self):
        # The plane that all our hyperbolic objects live in.
        plane = PolarPlane(size=5)

        # Draw the closed arc.
        arc = ClosedArc(
            center=Point(),
            radius=5.0,
            start_angle=0.0,
            angle=TAU / 8,
            plane=plane
        )
        self.add(arc)

property center: Point

The center of the circle that the ClosedArc lives on.

move_to(center: Point) ClosedArc[source]

Move center of the Mobject to certain Point3D.

rotated_by(angle: float) ClosedArc[source]

Rotate the ClosedArc by the given angle.

This is rotation around the origin and NOT around the center of the arc. Only when the center of the arc lies on the origin, do we actually adjust the start_angle.

Parameters:
  • angle (float) – The angle in radians to rotate the ClosedArc

  • by.

Returns:

The updated ClosedArc.

Return type:

ClosedArc

set_center_of_projection(point: Point) ClosedArc[source]

Change the center of projection of the ClosedArc.

Parameters:

point (hmanim.native.point.Point) – The new center of projection.

Returns:

The updated ClosedArc.

Return type:

ClosedArc

set_radius_to(radius: float) ClosedArc[source]

Set the radius of the ClosedArc.

Parameters:

radius (float) – The new radius.

Returns:

The updated ClosedArc.

Return type:

ClosedArc

class ClosedArcRotate(mobject=None, *args, use_override=True, **kwargs)[source]

Rotate an ClosedArc around the origin by a given angle.

Examples

Example: ClosedArcRotateExample

from manim import *

from hmanim.native import ClosedArc, ClosedArcRotate, Point

class ClosedArcRotateExample(Scene):
    def construct(self):
        # The plane that all our hyperbolic objects live in.
        plane = PolarPlane(size=5)

        # Draw the arc.
        arc = ClosedArc(
            center=Point(0.0, 0.0),
            radius=4.0,
            start_angle=0.0,
            angle=TAU / 8,
            plane=plane
        )
        self.add(arc)

        # Rotate the arc by TAU / 8 radians.
        self.play(ClosedArcRotate(arc, TAU / 8))
from hmanim.native import ClosedArc, ClosedArcRotate, Point

class ClosedArcRotateExample(Scene):
    def construct(self):
        # The plane that all our hyperbolic objects live in.
        plane = PolarPlane(size=5)

        # Draw the arc.
        arc = ClosedArc(
            center=Point(0.0, 0.0),
            radius=4.0,
            start_angle=0.0,
            angle=TAU / 8,
            plane=plane
        )
        self.add(arc)

        # Rotate the arc by TAU / 8 radians.
        self.play(ClosedArcRotate(arc, 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 ClosedArcScale(mobject=None, *args, use_override=True, **kwargs)[source]

Scale the radius of an ClosedArc by a given factor.

Examples

Example: ClosedArcScaleExample

from manim import *

from hmanim.native import ClosedArc, ClosedArcScale, Point

class ClosedArcScaleExample(Scene):
    def construct(self):
        # The plane that all our hyperbolic objects live in.
        plane = PolarPlane(size=5)

        # Draw the arc.
        arc = ClosedArc(
            center=Point(0.0, 0.0),
            radius=4.0,
            start_angle=0.0,
            angle=TAU / 8,
            plane=plane
        )
        self.add(arc)

        # Scale the arc radius by a factor of 1.5.
        self.play(ClosedArcScale(arc, 1.5))
from hmanim.native import ClosedArc, ClosedArcScale, Point

class ClosedArcScaleExample(Scene):
    def construct(self):
        # The plane that all our hyperbolic objects live in.
        plane = PolarPlane(size=5)

        # Draw the arc.
        arc = ClosedArc(
            center=Point(0.0, 0.0),
            radius=4.0,
            start_angle=0.0,
            angle=TAU / 8,
            plane=plane
        )
        self.add(arc)

        # Scale the arc radius by a factor of 1.5.
        self.play(ClosedArcScale(arc, 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 ClosedArcTranslate(mobject=None, *args, use_override=True, **kwargs)[source]

Translate an ClosedArc by a given distance.

Examples

Example: ClosedArcTranslateExample

from manim import *

from hmanim.native import ClosedArc, ClosedArcTranslate, Point

class ClosedArcTranslateExample(Scene):
    def construct(self):
        # The plane that all our hyperbolic objects live in.
        plane = PolarPlane(size=5)

        # Draw the arc.
        arc = ClosedArc(
            center=Point(0.0, 0.0),
            radius=4.0,
            start_angle=0.0,
            angle=TAU / 8,
            plane=plane
        )
        self.add(arc)

        # Translate the arc by a distance of 2.0.
        self.play(ClosedArcTranslate(arc, 2.0))
from hmanim.native import ClosedArc, ClosedArcTranslate, Point

class ClosedArcTranslateExample(Scene):
    def construct(self):
        # The plane that all our hyperbolic objects live in.
        plane = PolarPlane(size=5)

        # Draw the arc.
        arc = ClosedArc(
            center=Point(0.0, 0.0),
            radius=4.0,
            start_angle=0.0,
            angle=TAU / 8,
            plane=plane
        )
        self.add(arc)

        # Translate the arc by a distance of 2.0.
        self.play(ClosedArcTranslate(arc, 2.0))

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.