Class RectangleLineIntersector
- Namespace
- NetTopologySuite.Algorithm
- Assembly
- NetTopologySuite.dll
Computes whether a rectangle intersects line segments.
public class RectangleLineIntersector
- Inheritance
-
RectangleLineIntersector
- Inherited Members
Remarks
Rectangles contain a large amount of inherent symmetry (or to put it another way, although they contain four coordinates they only actually contain 4 ordinates worth of information). The algorithm used takes advantage of the symmetry of the geometric situation to optimize performance by minimizing the number of line intersection tests.
Constructors
RectangleLineIntersector(Envelope)
Creates a new intersector for the given query rectangle, specified as an Envelope.
public RectangleLineIntersector(Envelope rectEnv)
Parameters
rectEnv
EnvelopeThe query rectangle, specified as an Envelope
Methods
Intersects(Coordinate, Coordinate)
Tests whether the query rectangle intersects a given line segment.
public bool Intersects(Coordinate p0, Coordinate p1)
Parameters
p0
CoordinateThe first endpoint of the segment
p1
CoordinateThe second endpoint of the segment
Returns
- bool
true
if the rectangle intersects the segment