Lines#
Curves modules implements creation, modification and other related operations, with major support upto 3D space while making an attempt to work with arbitrary dimensions.
- class gbox.lines.LineSegmentND(p1: Sequence[float] | PointND, p2: Sequence[float] | PointND)#
Bases:
_TopologicalCurveNDConstructs a straight line from two points lying in n-dimensional space.
- Parameters:
- p1, p2list[float] | PointND
First and second point of the line
- property length: float32#
Length of the line in n-dimensional euclidean space
- property dim: int#
Dimension of the line
- equation()#
- class gbox.lines.LineSegment2D(p1: Sequence[float] | Point2D, p2: Sequence[float] | Point2D)#
Bases:
LineSegmentND- angle(rad=True) float32#
Returns the angle of the line w.r.t positive x-axis in [0, 2 * pi]