Line

A 2D line segment defined by two points.

Constructor

  • Line() Line
  • Line(
        ax: float,
        ay: float,
        bx: float,
        by: float
    ) Line
  • Line(ax: float, ay: float, b: Vec2) Line
  • Line(a: Vec2, bx: float, by: float) Line
  • Line(a: Vec2, b: Vec2) Line

A 2D line segment defined by two points.

Properties


NameDescriptionType
aGet or set point A as a tuple or Vec2.Vec2
bGet or set point B as a tuple or Vec2.Vec2
axX-coordinate of point A.float
ayY-coordinate of point A.float
bxX-coordinate of point B.float
byY-coordinate of point B.float
lengthThe Euclidean length of the line segment.float

Methods


Copy

copy() Line

Return a copy of this line.

Move

move(offset: Vec2) None

Move this line by a Vec2 or 2-element sequence.

Args

  • offset : The amount to move.