Rectangle2

References
public class Rectangle2
Represents a single, two-dimensional, orthogonal rectangle.

Constructors

Rectangle2

#
public Rectangle2()

Rectangle2

#
public Rectangle2(double x0, double y0, double x1, double y1)
x0 (double)
y0 (double)
x1 (double)
y1 (double)

Rectangle2

#
public Rectangle2(Node2 p0, Node2 p1)
p0 (Node2)
p1 (Node2)

Fields

x_max

#
public double x_max

x_min

#
public double x_min

y_max

#
public double y_max

y_min

#
public double y_min

Properties

IsValid

#
public bool IsValid { get; }

Methods

Grow

#
public void Grow(double x, double y)
Grow the rectangle to include a point. Rectangle must be increasing for this to work properly.
x (double)X-coordinate of point to include.
y (double)Y-coordinate of point to include.

Grow

#
public void Grow(Node2 pt)
Grow the rectangle to include a point. Rectangle must be increasing for this to work properly.
pt (Node2)Point to include in rectangle.

Grow

#
public void Grow(Rectangle2 rec)
rec (Rectangle2)

Includes

#
public Containment Includes(double x, double y)
Solve containment for a point and this rectangle.
x (double)
y (double)

Includes

#
public Containment Includes(Node2 pt)
Solve containment for a point and this rectangle.
pt (Node2)

Intersect

#
public Node2 Intersect(Line2 line)
Solve intersection between a semi-infinite line and the rectangle.
line (Line2)Semi-infinite line to intersect with.
The point on the semi-infinite line where the intersection occured.

MakeIncreasing

#
public void MakeIncreasing()
Ensure the limits are all increasing.

ParameterAt

#
public Node2 ParameterAt(double x, double y)
x (double)
y (double)

ParameterAt

#
public Node2 ParameterAt(Node2 pt)
pt (Node2)

PointAt

#
public Node2 PointAt(double x, double y)
Get a point in rectangle space.
x (double)Normalised parameter long rectangle x direction.
y (double)Normalised parameter long rectangle y direction.