new BoundingRectangle
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
-
height :Number
-
The height of the rectangle.
- Default Value:
- 0.0
-
width :Number
-
The width of the rectangle.
- Default Value:
- 0.0
-
x :Number
-
The x coordinate of the rectangle.
- Default Value:
- 0.0
-
y :Number
-
The y coordinate of the rectangle.
- Default Value:
- 0.0
Methods
-
clone
-
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. -
equals
-
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:
Booleantrue
if they are equal,false
otherwise. -
intersect
-
Determines if this rectangle intersects with another.
Parameters:
Name Type Description right
BoundingRectangle A rectangle to check for intersection. Returns:
-
<static> clone
-
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> equals
-
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:
Booleantrue
if left and right are equal,false
otherwise. -
<static> expand
-
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> fromPoints
-
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
andy
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> fromRectangle
-
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> intersect
-
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:
-
<static> union
-
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.