Class Rectangle2DDouble
java.lang.Object
de.xima.fc.common.geometry.Rectangle2DDouble
A 2-dimensional rectangle with double precision.
- Since:
- 8.4.0
-
Constructor Summary
ConstructorsConstructorDescriptionRectangle2DDouble(double x, double y, double width, double height) Creates a rectangle with the specified position and size.Rectangle2DDouble(Point2DDouble position, Rectangular2DDouble size) Creates a rectangle with the specified position and size. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the height of the rectangle.position()Returns the position of the rectangle, i.e. the coordinates of its top-left corner.size()Returns the size of the rectangle.translate(double deltaX, double deltaY) Translates the rectangle by the specified amounts in the x and y directions.doubleReturns the width of the rectangle.doublex1Double()Returns the x coordinate of the left edge of the rectangle.doublex2Double()Returns the x coordinate of the right edge of the rectangle.doublexDouble()Returns the x coordinate of the left edge of the rectangle.doubley1Double()Returns the y coordinate of the top edge corner of the rectangle.doubley2Double()Returns the y coordinate of the bottom edge corner of the rectangle.doubleyDouble()Returns the y coordinate of the top edge corner of the rectangle.
-
Constructor Details
-
Rectangle2DDouble
public Rectangle2DDouble(double x, double y, double width, double height) Creates a rectangle with the specified position and size.- Parameters:
x- The x-coordinate of the top-left corner of the rectangle.y- The y-coordinate of the top-left corner of the rectangle.width- The width of the rectangle.height- The height of the rectangle.
-
Rectangle2DDouble
Creates a rectangle with the specified position and size.- Parameters:
position- The position of the top-left corner of the rectangle.size- The size of the rectangle.
-
-
Method Details
-
heightDouble
public double heightDouble()Returns the height of the rectangle.- Returns:
- The height of the rectangle.
-
position
Returns the position of the rectangle, i.e. the coordinates of its top-left corner.- Returns:
- The position of the rectangle.
-
size
Returns the size of the rectangle.- Returns:
- The size of the rectangle.
-
translate
Translates the rectangle by the specified amounts in the x and y directions.- Parameters:
deltaX- The amount to translate the rectangle in the x direction.deltaY- The amount to translate the rectangle in the y direction.- Returns:
- A rectangle that is translated by the specified amounts.
-
widthDouble
public double widthDouble()Returns the width of the rectangle.- Returns:
- The width of the rectangle.
-
x1Double
public double x1Double()Returns the x coordinate of the left edge of the rectangle.- Returns:
- The x coordinate of the left edge of the rectangle.
-
x2Double
public double x2Double()Returns the x coordinate of the right edge of the rectangle.- Returns:
- The x coordinate of the right edge of the rectangle.
-
xDouble
public double xDouble()Returns the x coordinate of the left edge of the rectangle.- Returns:
- The x coordinate of the left edge of the rectangle.
-
y1Double
public double y1Double()Returns the y coordinate of the top edge corner of the rectangle.- Returns:
- The y coordinate of the top edge corner of the rectangle.
-
y2Double
public double y2Double()Returns the y coordinate of the bottom edge corner of the rectangle.- Returns:
- The y coordinate of the bottom edge corner of the rectangle.
-
yDouble
public double yDouble()Returns the y coordinate of the top edge corner of the rectangle.- Returns:
- The y coordinate of the top edge corner of the rectangle.
-