Update Rect_Geo.mdx
This commit is contained in:
parent
df576bae02
commit
fce814c8f7
|
@ -89,13 +89,13 @@ To create a new rectangle, use the following constructor:
|
|||
Rectangle newRect = new Rectangle(x, y, width, height);
|
||||
```
|
||||
|
||||
The `Rectangle` class supports numerous useful methods.
|
||||
The `Rectangle` class supports numerous useful methods, including the following:
|
||||
|
||||
- `firstRect.intersects(secondRect)` checks if two rectangles intersect.
|
||||
- `firstRect.union(secondRect)` returns a rectangle representing the union of two rectangles.
|
||||
- `firstRect.contains(x, y)` checks whether the integer point $(x,y)$ exists in firstRect.
|
||||
- `firstRect.intersection(secondRect)` returns a rectangle representing the intersection of two rectangles.
|
||||
- what happens when intersection is empty?
|
||||
- `firstRect.intersects(secondRect)` checks if two rectangles intersect.
|
||||
- `firstRect.union(secondRect)` returns a rectangle representing the union of two rectangles.
|
||||
- `firstRect.contains(x, y)` checks whether the integer point $(x,y)$ exists in firstRect.
|
||||
- `firstRect.intersection(secondRect)` returns a rectangle representing the intersection of two rectangles.
|
||||
- what happens when intersection is empty?
|
||||
|
||||
This class can often lessen the implementation needed in a lot of bronze problems and CodeForces problems.
|
||||
|
||||
|
|
Reference in a new issue