changed rect geo

This commit is contained in:
Michael Cao 2020-06-16 20:42:08 -05:00
parent f18feabfa0
commit 78cc5471f1

View file

@ -21,14 +21,14 @@ Rectangle newRect = new Rectangle(x, y, width, height);
The `Rectangle` class supports numerous useful methods.
```java
firstRect.intersects(secondRect)` checks if two rectangles intersect.
```
firstRect.intersects(secondRect) checks if two rectangles intersect.
firstRect.union(secondRect)` returns a rectangle representing the union of two rectangles.
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.contains(x, y) checks whether the integer point (x,y) exists in firstRect.
firstRect.intersect(secondRect)` returns a rectangle representing the intersection of two rectangles.
firstRect.intersect(secondRect) returns a rectangle representing the intersection of two rectangles.
```
This class can often lessen the implementation needed in a lot of bronze problems and codeforces problems.