Line

class Line(start_point: Point, end_point: Point, plane: PolarPlane, using_geodesic: bool = True, **kwargs)[source]

A geodesic line segment between two Point objects.

Examples

Example: LineExample

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

from hmanim.native import Line, Point

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

        line = Line(
            Point(3, 0),
            Point(3, TAU / 8),
            plane=plane,
            color=YELLOW,
        )
        self.add(line)
from hmanim.native import Line, Point

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

        line = Line(
            Point(3, 0),
            Point(3, TAU / 8),
            plane=plane,
            color=YELLOW,
        )
        self.add(line)

copy() Line[source]

Create and return an identical copy of the Mobject including all submobjects.

Returns:

The copy.

Return type:

Mobject

Note

The clone is initially not visible in the Scene, even if the original was.

get_end() Point[source]

Returns the point, where the stroke that surrounds the Mobject ends.

get_start() Point[source]

Returns the point, where the stroke that surrounds the Mobject starts.

move_to(start_point: Point, end_point: Point) Line[source]

Move center of the Mobject to certain Point3D.

rotated_by(angle: float) Line[source]

Rotate the polygonal chain around the origin by a given angle in radians.

Parameters:

angle (float) – The angle to rotate by.

Returns:

The rotated polygonal chain.

Return type:

PolygonalChain

translated_by(distance: float) Line[source]

Translate the polygonal chain by a given distance. See Point.translated_by() for more details.

Parameters:

distance (float) – The distance to translate by.

Returns:

The translated polygonal chain.

Return type:

PolygonalChain