libpysal.cg.
LineSegment
(start_pt, end_pt)[source]¶Geometric representation of line segment objects.
Parameters: |
|
---|---|
Attributes: |
|
Methods
get_swap () |
Returns a LineSegment object which has its endpoints swapped. |
intersect (other) |
Test whether segment intersects with other segment |
is_ccw (pt) |
Returns whether a point is counterclockwise of the segment. |
is_cw (pt) |
Returns whether a point is clockwise of the segment. |
sw_ccw (pt) |
Sedgewick test for pt being ccw of segment |
__init__
(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)))
Attributes: |
|
---|
Methods
__init__ (start_pt, end_pt) |
Creates a LineSegment object. |
get_swap () |
Returns a LineSegment object which has its endpoints swapped. |
intersect (other) |
Test whether segment intersects with other segment |
is_ccw (pt) |
Returns whether a point is counterclockwise of the segment. |
is_cw (pt) |
Returns whether a point is clockwise of the segment. |
sw_ccw (pt) |
Sedgewick test for pt being ccw of segment |
Attributes
bounding_box |
Returns the minimum bounding box of a LineSegment object. |
len |
Returns the length of a LineSegment object. |
line |
Returns a Line object of the line which the segment lies on. |
p1 |
HELPER METHOD. |
p2 |
HELPER METHOD. |