| |
- convex_polygon
- point
- segment
class convex_polygon |
|
A class for convex polygons. |
|
Methods defined here:
- __init__(self, vertices)
- The constructor requires a list of point objects.
- __repr__(self)
- contained_by_polygon(self, other)
- Tests to see if polygon 'self' is completely inside polygon 'other'. Returns
1 if this is the case, 0 otherwise.
- contains_point(self, a_point)
- Tests to see if the input point object is inside the polygon. Returns 1 if
this is the case, 0 otherwise.
- contains_polygon(self, other)
- Tests to see if polygon 'other' is completely inside polygon 'self'. Returns
1 if this is the case, 0 otherwise.
- equals(self, other)
- Returns 1 if self and other contain exactly the same vertices in the
same order.
|
class point |
|
A 2 dimensional cartesian coordinate point class |
|
Methods defined here:
- __init__(self, tup, y=None)
- Requires a tuple of two point objects.
- __repr__(self)
- equals(self, other)
- Returns 1 if self and other are the same point. Otherwise
returns 0.
|
class segment |
|
A class for line segments. |
|
Methods defined here:
- __init__(self, point1, point2)
- To construct a segment two point objects are required.
- __repr__(self)
- equals(self, other)
- Return 1 if self and other are exactly the same.
- intersect(self, other)
- Returns 1 if the two segments intersect, 0 otherwise.
- is_in_range(self, a_point)
- Check that the given point is between the two x coordinates
and the two y coordinates. Returns 1 if this is the case, 0 otherwise.
| |