Rectangular shape.

This class is used to define any arbitrary rectangular shape. Note that this class only describes the rectangular shape but does not hold any content.

## Attributes

- height
Height of the rectangular.

- width
Width of the rectangular.

- x
X-coordinate of the left top corner.

- y
Y-coordinate of the left top corner.

- See also:
CPArray2D 2D content holder.

- Companion:
- object
- Source:
- CPRect.scala
- Graph
- Supertypes

## Members list

## Value members

### Constructors

Creates rectangle from two tuples.

Creates rectangle from two tuples.

## Attributes

- p1
XY-coordinate of the top left corner.

- p2
XY-coordinate of the bottom right corner.

- Source:
- CPRect.scala

Creates rectangle from two tuples.

Creates rectangle from two tuples.

## Attributes

- p1
XY-coordinate of the top left corner.

- p2
XY-coordinate of the bottom right corner.

- Source:
- CPRect.scala

Creates rectangle.

Creates rectangle.

## Attributes

- dim
Dimension of the rectangle.

- x
X-coordinate of the top left corner.

- y
Y-coordinate of the top left corner.

- Source:
- CPRect.scala

Creates rectangle with `(0,0)`

left top corner and given dimension.

Creates rectangle with `(0,0)`

left top corner and given dimension.

## Attributes

- dim
Rectangle dimension.

- Source:
- CPRect.scala

### Concrete methods

Whether or not given point is contained within this rectangle. This includes a point on the edge of the rectangle.

Whether or not given point is contained within this rectangle. This includes a point on the edge of the rectangle.

## Attributes

- a
X coordinate.

- b
Y coordinate.

- Source:
- CPRect.scala

Tests whether this rectangle contains given rectangle.

Tests whether this rectangle contains given rectangle.

## Attributes

- rect
Rectangle to test.

- Source:
- CPRect.scala

Tests whether this rectangle contains given rectangle horizontally.

Tests whether this rectangle contains given rectangle horizontally.

## Attributes

- rect
Rectangle to test.

- Source:
- CPRect.scala

Tests whether this rectangle contains given rectangle vertically.

Tests whether this rectangle contains given rectangle vertically.

## Attributes

- rect
Rectangle to test.

- Source:
- CPRect.scala

Compares the receiver object (`this`

) with the argument object (`that`

) for equivalence.

Compares the receiver object (`this`

) with the argument object (`that`

) for equivalence.

Any implementation of this method should be an equivalence relation:

- It is reflexive: for any instance
`x`

of type`Any`

,`x.equals(x)`

should return`true`

. - It is symmetric: for any instances
`x`

and`y`

of type`Any`

,`x.equals(y)`

should return`true`

if and only if`y.equals(x)`

returns`true`

. - It is transitive: for any instances
`x`

,`y`

, and`z`

of type`Any`

if`x.equals(y)`

returns`true`

and`y.equals(z)`

returns`true`

, then`x.equals(z)`

should return`true`

.

If you override this method, you should verify that your implementation remains an equivalence relation.
Additionally, when overriding this method it is usually necessary to override `hashCode`

to ensure that
objects which are "equal" (`o1.equals(o2)`

returns `true`

) hash to the same scala.Int.
(`o1.hashCode.equals(o2.hashCode)`

).

## Attributes

- that
the object to compare against this object for equality.

- Returns:
`true`

if the receiver object is equivalent to the argument;`false`

otherwise.- Definition Classes
- Equals -> CPIntTuple -> Any
- Source:
- CPRect.scala

Tests whether this rectangle has at least one points satisfying given predicate.

Tests whether this rectangle has at least one points satisfying given predicate.

## Attributes

- f
Predicate to test.

- Source:
- CPRect.scala

Creates new rectangle grown in size enough to contain a given point. This method always creates new rectangle and its dimension will always be equal or larger than the dimension of this rectangle.

Creates new rectangle grown in size enough to contain a given point. This method always creates new rectangle and its dimension will always be equal or larger than the dimension of this rectangle.

## Attributes

- x2
X-coordinate of the point.

- y2
Y-coordinate of the point.

- Source:
- CPRect.scala

Creates intersection rectangle between this rectangle and a given one. If rectangles don't intersect, CPRect.ZERO is returned.

Creates intersection rectangle between this rectangle and a given one. If rectangles don't intersect, CPRect.ZERO is returned.

## Attributes

- rect
Rectangle to intersect with.

- Source:
- CPRect.scala

Tests whether this rectangle is position above of the given rectangle.

Tests whether this rectangle is position above of the given rectangle.

## Attributes

- r
Rectangle to test.

- Source:
- CPRect.scala

Tests whether this rectangle is position below of the given rectangle.

Tests whether this rectangle is position below of the given rectangle.

## Attributes

- r
Rectangle to test.

- Source:
- CPRect.scala

Tests whether this rectangle is position to the left of the given rectangle.

Tests whether this rectangle is position to the left of the given rectangle.

## Attributes

- r
Rectangle to test.

- Source:
- CPRect.scala

Tests whether this rectangle is position to the right of the given rectangle.

Tests whether this rectangle is position to the right of the given rectangle.

## Attributes

- r
Rectangle to test.

- Source:
- CPRect.scala

Calls given XY-coordinate function on each point in this rectangle. Iteration over the points in this rectangle will be horizontal first. In other words, given the rectangle with the following coordinates:

Calls given XY-coordinate function on each point in this rectangle. Iteration over the points in this rectangle will be horizontal first. In other words, given the rectangle with the following coordinates:

```
+-----------------+
|(0,0) (1,0) (2,0)|
|(0,1) (1,1) (2,1)|
|(0,2) (1,2) (2,2)|
+-----------------+
```

this method will iterate in the following order:

```
(0,0) (1,0) (2,0) (0,1) (1,1) (2,1) (0,2) (1,2) (2,2)
```

## Attributes

- f
XY-coordinate function to call.

- See also:
- Source:
- CPRect.scala

Calls given XY-coordinate function on each point in this rectangle. Iteration over the points in this rectangle will be horizontal first. In other words, given the rectangle with the following coordinates:

```
+-----------------+
|(0,0) (1,0) (2,0)|
|(0,1) (1,1) (2,1)|
|(0,2) (1,2) (2,2)|
+-----------------+
```

this method will iterate in the following order:

```
(0,0) (1,0) (2,0) (0,1) (1,1) (2,1) (0,2) (1,2) (2,2)
```

## Attributes

- f
XY-coordinate function to call.

- See also:
- Source:
- CPRect.scala

Calls given XY-coordinate function on each point in this rectangle. Iteration over the points in this rectangle will be vertical first. In other words, given the rectangle with the following coordinates:

Calls given XY-coordinate function on each point in this rectangle. Iteration over the points in this rectangle will be vertical first. In other words, given the rectangle with the following coordinates:

```
+-----------------+
|(0,0) (1,0) (2,0)|
|(0,1) (1,1) (2,1)|
|(0,2) (1,2) (2,2)|
+-----------------+
```

this method will iterate in the following order:

```
(0,0) (0,1) (0,2) (1,0) (1,1) (1,2) (2,0) (2,1) (2,2)
```

## Attributes

- f
XY-coordinate function to call.

- See also:
- Source:
- CPRect.scala

Tests whether or not this rectangle overlaps with the given one. Note that "touching" rectangles do not intersect as far as this method is concerned.

Tests whether or not this rectangle overlaps with the given one. Note that "touching" rectangles do not intersect as far as this method is concerned.

## Attributes

- rect
Rectangle to test.

- Source:
- CPRect.scala

Gets random X-coordinate within this rectangle.

Gets random XY-coordinate within this rectangle.

Gets random Y-coordinate within this rectangle.

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

## Attributes

- Returns:
a string representation of the object.

- Definition Classes
- CPIntTuple -> Any
- Source:
- CPRect.scala

Creates new rectangle with a minimal size to contain both this and given rectangle.

Creates new rectangle with a minimal size to contain both this and given rectangle.

## Attributes

- rect
Rectangle to combine with this rectangle.

- Source:
- CPRect.scala

### Inherited methods

Multiplies given value with each member of this tuple.

Multiplies given value with each member of this tuple.

## Attributes

- x
Value to multiple by.

- Returns:
New tuple as a result of multiplication.

- Inherited from:
- CPIntTuple (hidden)
- Source:
- CPIntTuple.scala

Multiple two tuples by multiplying their corresponding values.

Multiple two tuples by multiplying their corresponding values.

## Attributes

- x
Other tuple to multiply with.

- Note:
Tuples must have the same arity.

- Inherited from:
- CPIntTuple (hidden)
- Source:
- CPIntTuple.scala

Adds given value to each member of this tuple.

Adds given value to each member of this tuple.

## Attributes

- x
Value to add.

- Returns:
New tuple as a result of addition.

- Inherited from:
- CPIntTuple (hidden)
- Source:
- CPIntTuple.scala

Adds two tuples by adding their corresponding values.

Adds two tuples by adding their corresponding values.

## Attributes

- x
Tuple to add.

- Note:
Tuples must have the same arity.

- Inherited from:
- CPIntTuple (hidden)
- Source:
- CPIntTuple.scala

Subtracts given value from each member of this tuple.

Subtracts given value from each member of this tuple.

## Attributes

- x
Value to subtract.

- Returns:
New tuple as a result of subtraction.

- Inherited from:
- CPIntTuple (hidden)
- Source:
- CPIntTuple.scala

Subtracts given tuple from this one by subtracting their corresponding values.

Subtracts given tuple from this one by subtracting their corresponding values.

## Attributes

- x
Tuple to subtract.

- Note:
Tuples must have the same arity.

- Inherited from:
- CPIntTuple (hidden)
- Source:
- CPIntTuple.scala

Divides each member of this tuple by the given value.

Divides each member of this tuple by the given value.

## Attributes

- x
Value to divide by.

- Returns:
New tuple as a result of division.

- Inherited from:
- CPIntTuple (hidden)
- Source:
- CPIntTuple.scala

Device this tuple by the given tuple by dividing their corresponding values.

Device this tuple by the given tuple by dividing their corresponding values.

## Attributes

- x
Other tuple to divide by.

- Note:
Tuples must have the same arity.

- Inherited from:
- CPIntTuple (hidden)
- Source:
- CPIntTuple.scala

Less-then '<' operator for `int`

.

Less-then '<' operator for `int`

.

## Attributes

- x
Other tuple to compare.

- Inherited from:
- CPIntTuple (hidden)
- Source:
- CPIntTuple.scala

Less-then '<' operator for tuples.

Less-then '<' operator for tuples.

## Attributes

- x
Other tuple to compare.

- Note:
Tuples must have the same arity.

- Inherited from:
- CPIntTuple (hidden)
- Source:
- CPIntTuple.scala

Less-then-or-equal '<=' operator for tuples.

Less-then-or-equal '<=' operator for tuples.

## Attributes

- x
Other tuple to compare.

- Note:
Tuples must have the same arity.

- Inherited from:
- CPIntTuple (hidden)
- Source:
- CPIntTuple.scala

Less-then-or-equal '<=' operator for `int`

.

Less-then-or-equal '<=' operator for `int`

.

## Attributes

- x
Other tuple to compare.

- Inherited from:
- CPIntTuple (hidden)
- Source:
- CPIntTuple.scala

Greater-then '>' operator for tuples.

Greater-then '>' operator for tuples.

## Attributes

- x
Other tuple to compare.

- Note:
Tuples must have the same arity.

- Inherited from:
- CPIntTuple (hidden)
- Source:
- CPIntTuple.scala

Greater-then '>' operator for `int`

.

Greater-then '>' operator for `int`

.

## Attributes

- x
Other tuple to compare.

- Note:
Tuples must have the same arity.

- Inherited from:
- CPIntTuple (hidden)
- Source:
- CPIntTuple.scala

Greater-then-or-equal '>=' operator for tuples.

Greater-then-or-equal '>=' operator for tuples.

## Attributes

- x
Other tuple to compare.

- Note:
Tuples must have the same arity.

- Inherited from:
- CPIntTuple (hidden)
- Source:
- CPIntTuple.scala

Greater-then-or-equal '>=' operator for `int`

.

Greater-then-or-equal '>=' operator for `int`

.

## Attributes

- x
Other tuple to compare.

- Note:
Tuples must have the same arity.

- Inherited from:
- CPIntTuple (hidden)
- Source:
- CPIntTuple.scala

## Attributes

- Definition Classes
- CPInt4 -> Ordered
- Inherited from:
- CPInt4
- Source:
- CPInt4.scala

Creates a copy of this tuple.

Tests whether all values in this tuple are one.

Tests whether all values in this tuple are one.

## Attributes

- Inherited from:
- CPIntTuple (hidden)
- Source:
- CPIntTuple.scala

Checks if this tuple contains only positive (> 0) numbers.

Checks if this tuple contains only positive (> 0) numbers.

## Attributes

- Inherited from:
- CPIntTuple (hidden)
- Source:
- CPIntTuple.scala

Checks if this tuple contains only whole (>= 0) numbers.

Checks if this tuple contains only whole (>= 0) numbers.

## Attributes

- Inherited from:
- CPIntTuple (hidden)
- Source:
- CPIntTuple.scala

Tests whether all values in this tuple are zero.

Tests whether all values in this tuple are zero.

## Attributes

- Inherited from:
- CPIntTuple (hidden)
- Source:
- CPIntTuple.scala

Maps this tuple using given function.

Maps this tuple using given function.

## Attributes

- f
Mapping function.

- Inherited from:
- CPIntTuple (hidden)
- Source:
- CPIntTuple.scala

## Attributes

- Inherited from:
- Product

## Attributes

- Inherited from:
- Product

### Concrete fields

Area of this rectangle as `width * height`

.

X-coordinate of the center point.

X-coordinate of the center point as a float.

Y-coordinate of the center point.

Y-coordinate of the center point as a float.

Dimension of this rectangle.

Height of the rectangular (shortcut API).

Height of the rectangular (shortcut API) as a float.

Whether width or height equals to zero.

Whether width and height are greater than zero.

Width of the rectangular (shortcut API).

Width of the rectangular (shortcut API) as a float.

Maximum X-coordinate. If width is zero this will equal to `x - 1`

.

Maximum X-coordinate as a float. If width is zero this will equal to `x - 1`

.

Maximum X-coordinate as a float. If width is zero this will equal to `x - 1`

.

## Attributes

- Source:
- CPRect.scala

Minimal X-coordinate. It is equal to `x`

.

Minimal X-coordinate as a float. It is equal to `x`

.

Maximum Y-coordinate. If height is zero this will equal to `y - 1`

.

Maximum Y-coordinate as a float. If height is zero this will equal to `y - 1`

.

Maximum Y-coordinate as a float. If height is zero this will equal to `y - 1`

.

## Attributes

- Source:
- CPRect.scala

Minimal Y-coordinate. It is equal to `y`

.

Minimal Y-coordinate as a float. It is equal to `y`

.

### Inherited fields

Arity of this tuple.

## Attributes

- Inherited from:
- CPInt4
- Source:
- CPInt4.scala

## Attributes

- Inherited from:
- CPInt4
- Source:
- CPInt4.scala

## Attributes

- Inherited from:
- CPInt4
- Source:
- CPInt4.scala

## Attributes

- Inherited from:
- CPInt4
- Source:
- CPInt4.scala

## Attributes

- Inherited from:
- CPIntTuple (hidden)
- Source:
- CPIntTuple.scala