libpysal.cg.
LineSegment
(start_pt, end_pt)[source]¶Geometric representation of line segment objects.
Point where segment begins
Point where segment ends
p1
PointHELPER METHOD.
p2
PointHELPER METHOD.
bounding_box
tupleReturns the minimum bounding box of a LineSegment object.
len
floatReturns the length of a LineSegment object.
line
LineReturns a Line object of the line which the segment lies on.
Methods
|
Returns a LineSegment object which has its endpoints swapped. |
|
Test whether segment intersects with other segment |
|
Returns whether a point is counterclockwise of the segment. |
|
Returns whether a point is clockwise of the segment. |
|
Sedgewick test for pt being ccw of segment |
__init__
(self, start_pt, end_pt)[source]¶Creates a LineSegment object.
__init__(Point, Point) -> LineSegment
Test tag: <tc>#is#LineSegment.__init__</tc> Test tag: <tc>#tests#LineSegment.__init__</tc>
Examples
>>> ls = LineSegment(Point((1, 2)), Point((5, 6)))
Methods
|
Creates a LineSegment object. |
|
Returns a LineSegment object which has its endpoints swapped. |
|
Test whether segment intersects with other segment |
|
Returns whether a point is counterclockwise of the segment. |
|
Returns whether a point is clockwise of the segment. |
|
Sedgewick test for pt being ccw of segment |
Attributes
|
Returns the minimum bounding box of a LineSegment object. |
|
Returns the length of a LineSegment object. |
|
Returns a Line object of the line which the segment lies on. |
|
HELPER METHOD. |
|
HELPER METHOD. |