Skip to content

Line

Line Parameters#

Paremeters - as mentioned in Azarzadvillas Documentation - are:

  • Constructor : - Line -DashedLine

  • start : Start point of the line

    • numpy array of dimension 3 (ex: (0,0,0))
    • Optional
    • Default: LEFT
  • end : End point of the line

    • numpy array of dimension 3 (ex: (1,3,0))
    • Optional
    • Default: RIGHT
  • path_arc : If set to None, the line is a straight line. Otherwise, the line is a curved line between start and end with the angle specified

    • float (in radians) (ex: math.radians(80))
    • Optional
    • Default: None

Straight Line#

from manimlib import *

class StraightLine(Scene):
    def construct(self):
        line = Line(start=(0,0,0), end=(2,2,0), color=YELLOW)
        self.play(ShowCreation(line))
        self.wait(2)
from manim import *

class StraightLine(Scene):
    def construct(self):
        line = Line(start=(0,0,0), end=(2,2,0), color=YELLOW)
        self.play(Create(line))
        self.wait(2)

Curved Line#

from manimlib import *

class CurvedLine(Scene):
    def construct(self):
        line = Line(start=(0,0,0), end=(3,0,0), path_arc=math.radians(-80), color=YELLOW)
        self.play(ShowCreation(line))
        self.wait(2)
from manim import *

class CurvedLine(Scene):
    def construct(self):
        line = Line(start=(0,0,0), end=(3,0,0), path_arc=-1.39626 , color=YELLOW)
        self.play(Create(line))
        self.wait(2)

Dashed Line#

from manimlib import *

class LineDashed(Scene):
    def construct(self):
        Dline = DashedLine(start=(0,0,0), end=(2,2,0), dash_length=0.2, color=YELLOW)
        self.play(ShowCreation(Dline))
        self.wait(2)
from manim import *

class LineDashed(Scene):
    def construct(self):
        Dline = DashedLine(start=(0,0,0), end=(2,2,0), dash_length=0.2, color=YELLOW)
        self.play(Create(Dline))
        self.wait(2)
Back to top