Line
A representation of a line segment.
Constructor
-
Line() -
Line(a: Vec2, b: Vec2) -
Line(a: Vec2, bx: float, by: float) -
Line(ax: float, ay: float, b: Vec2) -
Line(ax: float, ay: float, bx: float, by: float)
Parameters
a: Point A as a Vec2.b: Point B as a Vec2.ax: X-coordinate of point A.ay: Y-coordinate of point A.bx: X-coordinate of point B.by: Y-coordinate of point B.
Properties
| Name | Description | Type |
|---|---|---|
a | The starting point of the line | Vec2 |
b | The ending point of the line | Vec2 |
ax | The x-coordinate of the starting point | float |
ay | The y-coordinate of the starting point | float |
bx | The x-coordinate of the ending point | float |
by | The y-coordinate of the ending point | float |
length | The length of the line | float |
Methods
Move
move(offset: Vec2) → NoneMove the line by a specified offset.
Parameters
offset: The offset to move the line by.
Copy
copy() → LineCreate a copy of the line.