pythagoras.f

## Interface IRectangle

• ### Field Summary

Fields
Modifier and Type Field and Description
`static int` `OUT_BOTTOM`
The bitmask that indicates that a point lies below this rectangle.
`static int` `OUT_LEFT`
The bitmask that indicates that a point lies to the left of this rectangle.
`static int` `OUT_RIGHT`
The bitmask that indicates that a point lies to the right of this rectangle.
`static int` `OUT_TOP`
The bitmask that indicates that a point lies above this rectangle.
• ### Method Summary

All Methods
Modifier and Type Method and Description
`Rectangle` `clone()`
Returns a mutable copy of this rectangle.
`Rectangle` ```intersection(float rx, float ry, float rw, float rh)```
Returns the intersection of the specified rectangle and this rectangle (i.e.
`Rectangle` `intersection(IRectangle r)`
Returns the intersection of the supplied rectangle and this rectangle (i.e.
`boolean` ```intersectsLine(float x1, float y1, float x2, float y2)```
Returns true if the specified line segment intersects this rectangle.
`boolean` `intersectsLine(ILine l)`
Returns true if the supplied line segment intersects this rectangle.
`Point` `location()`
Returns a copy of this rectangle's upper-left corner.
`Point` `location(Point target)`
Initializes the supplied point with this rectangle's upper-left corner.
`int` ```outcode(float px, float py)```
Returns a set of flags indicating where the specified point lies in relation to the bounds of this rectangle.
`int` `outcode(XY point)`
Returns a set of flags indicating where the supplied point lies in relation to the bounds of this rectangle.
`Dimension` `size()`
Returns a copy of this rectangle's size.
`Dimension` `size(Dimension target)`
Initializes the supplied dimension with this rectangle's size.
`Rectangle` `union(IRectangle r)`
Returns the union of the supplied rectangle and this rectangle (i.e.
• ### Methods inherited from interface pythagoras.f.IRectangularShape

`center, centerX, centerY, frame, frame, height, max, maxX, maxY, min, minX, minY, width, x, y`
• ### Methods inherited from interface pythagoras.f.IShape

`bounds, bounds, contains, contains, contains, contains, intersects, intersects, isEmpty, pathIterator, pathIterator`
• ### Method Detail

• #### location

`Point location()`
Returns a copy of this rectangle's upper-left corner.
• #### location

`Point location(Point target)`
Initializes the supplied point with this rectangle's upper-left corner.
Returns:
the supplied point.
• #### size

`Dimension size()`
Returns a copy of this rectangle's size.
• #### size

`Dimension size(Dimension target)`
Initializes the supplied dimension with this rectangle's size.
Returns:
the supplied dimension.
• #### intersection

```Rectangle intersection(float rx,
float ry,
float rw,
float rh)```
Returns the intersection of the specified rectangle and this rectangle (i.e. the largest rectangle contained in both this and the specified rectangle).
• #### intersection

`Rectangle intersection(IRectangle r)`
Returns the intersection of the supplied rectangle and this rectangle (i.e. the largest rectangle contained in both this and the supplied rectangle).
• #### union

`Rectangle union(IRectangle r)`
Returns the union of the supplied rectangle and this rectangle (i.e. the smallest rectangle that contains both this and the supplied rectangle).
• #### intersectsLine

```boolean intersectsLine(float x1,
float y1,
float x2,
float y2)```
Returns true if the specified line segment intersects this rectangle.
• #### intersectsLine

`boolean intersectsLine(ILine l)`
Returns true if the supplied line segment intersects this rectangle.
• #### outcode

```int outcode(float px,
float py)```
Returns a set of flags indicating where the specified point lies in relation to the bounds of this rectangle. See `OUT_LEFT`, etc.
• #### outcode

`int outcode(XY point)`
Returns a set of flags indicating where the supplied point lies in relation to the bounds of this rectangle. See `OUT_LEFT`, etc.
• #### clone

`Rectangle clone()`
Returns a mutable copy of this rectangle.