public class RectD
extends java.lang.Object
| Constructor and Description |
|---|
RectD(double width,
double height) |
RectD(double x,
double y,
double width,
double height) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(RectD rect)
Check if this rectangle contains another rectangle.
|
double |
getArea() |
double |
getHeight() |
double |
getWidth() |
double |
getX() |
double |
getY() |
RectD |
intersection(RectD rect)
Get the intersection of this rectangle with another rectangle.
|
boolean |
intersects(RectD rect)
Check if this rectangle intersects with another rectangle.
|
boolean |
isSquare() |
RectD |
scale(double scale)
Scale the rectangle by the same factor in both directions.
|
RectD |
scale(double scaleX,
double scaleY)
Scale the rectangle by different factors in both directions.
|
RectD |
translate(double x,
double y)
Translate the rectangle by the given values.
|
public static final RectD ZERO
public RectD(double width,
double height)
public RectD(double x,
double y,
double width,
double height)
public double getX()
public double getY()
public double getWidth()
public double getHeight()
public RectD translate(double x, double y)
x - The x translationy - The y translationpublic double getArea()
public boolean isSquare()
public RectD scale(double scale)
scale - The scale factorpublic RectD scale(double scaleX, double scaleY)
scaleX - The scale factor for the x directionscaleY - The scale factor for the y directionpublic boolean intersects(RectD rect)
rect - The other rectanglepublic boolean contains(RectD rect)
rect - The other rectangle