BoundingRectangle

BoundingRectangle

new

A bounding rectangle given by a corner, width and height.

Parameters:
Name Type Argument Default Description
x Number <optional>
0.0 The x coordinate of the rectangle.
y Number <optional>
0.0 The y coordinate of the rectangle.
width Number <optional>
0.0 The width of the rectangle.
height Number <optional>
0.0 The height of the rectangle.
See:
Source:

Members

:Number

The height of the rectangle.
Default Value:
  • 0.0

:Number

The width of the rectangle.
Default Value:
  • 0.0

:Number

The x coordinate of the rectangle.
Default Value:
  • 0.0

:Number

The y coordinate of the rectangle.
Default Value:
  • 0.0

Methods

Duplicates this BoundingRectangle instance.

Parameters:
Name Type Argument Description
result BoundingRectangle <optional>
The object onto which to store the result.
Returns:
BoundingRectangle The modified result parameter or a new BoundingRectangle instance if one was not provided.

Compares this BoundingRectangle against the provided BoundingRectangle componentwise and returns true if they are equal, false otherwise.

Parameters:
Name Type Argument Description
right BoundingRectangle <optional>
The right hand side BoundingRectangle.
Returns:
Boolean true if they are equal, false otherwise.

Determines if this rectangle intersects with another.

Parameters:
Name Type Description
right BoundingRectangle A rectangle to check for intersection.
Returns:
Intersect Intersect.INTESECTING if the rectangles intersect, Intersect.OUTSIDE otherwise.

<static>

Duplicates a BoundingRectangle instance.

Parameters:
Name Type Argument Description
rectangle BoundingRectangle The bounding rectangle to duplicate.
result BoundingRectangle <optional>
The object onto which to store the result.
Returns:
BoundingRectangle The modified result parameter or a new BoundingRectangle instance if one was not provided. (Returns undefined if rectangle is undefined)

<static>

Compares the provided BoundingRectangles componentwise and returns true if they are equal, false otherwise.

Parameters:
Name Type Argument Description
left BoundingRectangle <optional>
The first BoundingRectangle.
right BoundingRectangle <optional>
The second BoundingRectangle.
Returns:
Boolean true if left and right are equal, false otherwise.

<static>

Computes a bounding rectangle by enlarging the provided rectangle until it contains the provided point.

Parameters:
Name Type Argument Description
rectangle BoundingRectangle A rectangle to expand.
point Cartesian2 A point to enclose in a bounding rectangle.
result BoundingRectangle <optional>
The object onto which to store the result.
Returns:
BoundingRectangle The modified result parameter or a new BoundingRectangle instance if one was not provided.

<static>

Computes a bounding rectangle enclosing the list of 2D points. The rectangle is oriented with the corner at the bottom left.

Parameters:
Name Type Argument Description
positions Array List of points that the bounding rectangle will enclose. Each point must have x and y properties.
result BoundingRectangle <optional>
The object onto which to store the result.
Returns:
BoundingRectangle The modified result parameter or a new BoundingRectangle instance if one was not provided.

<static>

Computes a bounding rectangle from an rectangle.

Parameters:
Name Type Argument Default Description
rectangle Rectangle The valid rectangle used to create a bounding rectangle.
projection Object <optional>
GeographicProjection The projection used to project the rectangle into 2D.
result BoundingRectangle <optional>
The object onto which to store the result.
Returns:
BoundingRectangle The modified result parameter or a new BoundingRectangle instance if one was not provided.

<static>

Determines if two rectangles intersect.

Parameters:
Name Type Description
left BoundingRectangle A rectangle to check for intersection.
right BoundingRectangle The other rectangle to check for intersection.
Returns:
Intersect Intersect.INTESECTING if the rectangles intersect, Intersect.OUTSIDE otherwise.

<static>

Computes a bounding rectangle that is the union of the left and right bounding rectangles.

Parameters:
Name Type Argument Description
left BoundingRectangle A rectangle to enclose in bounding rectangle.
right BoundingRectangle A rectangle to enclose in a bounding rectangle.
result BoundingRectangle <optional>
The object onto which to store the result.
Returns:
BoundingRectangle The modified result parameter or a new BoundingRectangle instance if one was not provided.