Click or drag to resize
Interval2D Class
The Interval2D class represents a closed two-dimensional interval, which represents all points (x, y) with both xmin <= x <= xmax and ymin <= y <= ymax. Two-dimensional intervals are immutable: their values cannot be changed after they are created. The class Interval2D includes methods for checking whether a two-dimensional interval contains a point and determining whether two two-dimensional intervals intersect.
Inheritance Hierarchy

Namespace: Algs4Net
Assembly: Algs4Net (in Algs4Net.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class Interval2D : BasicVisual

The Interval2D type exposes the following members.

Constructors
  NameDescription
Public methodInterval2D
Initializes a two-dimensional interval.
Top
Methods
  NameDescription
Public methodArea
Returns the area of this two-dimensional interval.
Public methodContains
Does this two-dimensional interval contain the point p?
Public methodDraw
Draws this two-dimensional interval to the display.
(Overrides BasicVisualDraw.)
Public methodEquals
Does this interval equal the other interval?
(Overrides ObjectEquals(Object).)
Public methodGetHashCode
Returns an integer hash code for this interval.
(Overrides ObjectGetHashCode.)
Public methodIntersects
Does this two-dimensional interval intersect that two-dimensional interval?
Public methodStatic memberMainTest
Demo test the Interval2D data type.
Public methodToString
Returns a string representation of this two-dimensional interval.
(Overrides ObjectToString.)
Top
Remarks

For additional documentation, see Section 1.2 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.

This class is a C# port from the original Java class Interval2D implementation by the respective authors.

See Also