edu.gwu.algtest
Interface LineSegmentIntersectionAlgorithm

All Superinterfaces:
edu.gwu.algtest.Algorithm

public interface LineSegmentIntersectionAlgorithm
extends edu.gwu.algtest.Algorithm

Interface LineSegmentIntersectionAlgorithm must be implemented by algorithms that solve the line-segment intersection problem. The input to this problem is a collection of line segments that lie in a known region (typically, the unit square). A line segment is a straight line joining two points. Since two given line segments may intersect, it is of interest to count the total number of intersections, and also to find the intersection points. An algorithm that implements this interface is required to find all such intersection points. Note that intersections include the case where one line segments ends in the middle of another.

See Also:
Algorithm

Method Summary
 Pointd[] findIntersections(LineSegment[] segments)
          Method findIntersections is called by the tester with data, an array of line-segments.
 
Methods inherited from interface edu.gwu.algtest.Algorithm
getName, setPropertyExtractor
 

Method Detail

findIntersections

public Pointd[] findIntersections(LineSegment[] segments)
Method findIntersections is called by the tester with data, an array of line-segments. The return value is a list of intersection points. If no intersections exist, the algorithm is required to return null.
Parameters:
segments - a LineSegment[] value
Returns:
a Pointd[] value