java.lang.Objectcomputational.geometry.TwoSegmentIntersection
public class TwoSegmentIntersection
Field Summary | |
---|---|
static int |
HIT_ENDPOINT
One segment's endpoint hits the the other segment. |
static int |
NO_INTERSECTION
The two segments do not intersect. |
static int |
PROPER_INTERSECTION
The two segments intersects in an internal point. |
static int |
SEGMENT_OVERLAY
The two segments overlays, either partially or completely. |
Constructor Summary | |
---|---|
TwoSegmentIntersection(Segment s0,
Segment s1)
Builds a TwoSegmentIntersection object wrapping
information about intersection between two segments. |
Method Summary | |
---|---|
RealShape |
getIntersection()
Returns the intersection between the two segments, that is the set of points belonging to both segments. |
java.util.List |
getSegments()
Returns a list containing the two segments interested in this intersection. |
int |
getType()
Returns the type of intersection between the two segments, i.e.: NO_INTERSECTION if segments do not intersect; PROPER_INTERSECTION if segments intersect properly; SEGMENT_OVERLAY if segments overlays, either partially or completely; HIT_ENDPOINT if one segment's endpoint hits the the other segment. |
static int |
intersect(Segment s,
Segment t)
Computes the kind of intersection between two segments. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int HIT_ENDPOINT
public static final int NO_INTERSECTION
public static final int PROPER_INTERSECTION
public static final int SEGMENT_OVERLAY
Constructor Detail |
---|
public TwoSegmentIntersection(Segment s0, Segment s1)
TwoSegmentIntersection
object wrapping
information about intersection between two segments.
s0
- the first segment.s1
- the second segment.Method Detail |
---|
public RealShape getIntersection()
null
;double
coordinates,
represented by a RealPoint
object;double
coordinates, representeb by a
RealSegment
object.
Even if, for segment intersection, a Segment
would have sufficed in this case, we decided to be general
by returning RealShape
objects to represent
intersections between Shape
objects.
public java.util.List getSegments()
public int getType()
public static int intersect(Segment s, Segment t)
s
- the first segment.t
- the second segment.
BasicTests.intersectProperly(Segment,Segment)
,
BasicTests.intersect(Segment,Segment)
public java.lang.String toString()
toString
in class java.lang.Object