Click or drag to resize
RectHV Class
The RectHV class is an immutable data type to encapsulate a two-dimensional axis-aligned rectagle with real-value coordinates. The rectangle is Closed; it includes the points on the boundary.
Inheritance Hierarchy

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

The RectHV type exposes the following members.

Constructors
  NameDescription
Public methodRectHV
Initializes a new rectangle [Xmin, Xmax] x [Ymin, Ymax].
Top
Properties
  NameDescription
Public propertyHeight
Returns the height of this rectangle.
Public propertyWidth
Returns the width of this rectangle.
Public propertyXmax
Returns the maximum X-coordinate of any point in this rectangle.
Public propertyXmin
Returns the minimum X-coordinate of any point in this rectangle.
Public propertyYmax
Returns the maximum Y-coordinate of any point in this rectangle.
Public propertyYmin
Returns the minimum Y-coordinate of any point in this rectangle.
Top
Methods
  NameDescription
Public methodContains
Returns true if this rectangle contain the point.
Public methodDistanceSquaredTo
Returns the square of the Euclidean distance between this rectangle and the point p.
Public methodDistanceTo
Returns the Euclidean distance between this rectangle and the point p.
Public methodDraw
Draws this rectangle to standard draw.
(Overrides BasicVisualDraw.)
Public methodEquals
Compares this rectangle to the specified rectangle.
(Overrides ObjectEquals(Object).)
Public methodGetHashCode
Returns an integer hash code for this rectangle.
(Overrides ObjectGetHashCode.)
Public methodIntersects
Returns true if the two rectangles intersect.
Public methodStatic memberMainTest
Demo test for the RectHVTest data type.
Public methodToString
Returns a string representation of this rectangle.
(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 RectHV implementation by the respective authors.

See Also