- java.lang.Object
-
- org.arakhne.afc.math.geometry.d2.d.AbstractShape2d<Rectangle2d>
-
- org.arakhne.afc.math.geometry.d2.d.Rectangle2d
-
- All Implemented Interfaces:
Serializable,Cloneable,OrientedRectangle2afp<Shape2d<?>,Rectangle2d,PathElement2d,Point2d,Vector2d,Rectangle2d>,Parallelogram2afp<Shape2d<?>,Rectangle2d,PathElement2d,Point2d,Vector2d,Rectangle2d>,Rectangle2afp<Shape2d<?>,Rectangle2d,PathElement2d,Point2d,Vector2d,Rectangle2d>,RectangularShape2afp<Shape2d<?>,Rectangle2d,PathElement2d,Point2d,Vector2d,Rectangle2d>,Shape2afp<Shape2d<?>,Rectangle2d,PathElement2d,Point2d,Vector2d,Rectangle2d>,Shape2d<Rectangle2d>,Shape2D<Shape2d<?>,Rectangle2d,PathIterator2afp<PathElement2d>,Point2d,Vector2d,Rectangle2d>,JsonableObject
public class Rectangle2d extends AbstractShape2d<Rectangle2d> implements Rectangle2afp<Shape2d<?>,Rectangle2d,PathElement2d,Point2d,Vector2d,Rectangle2d>
A rectangle with 2 double precision floating-point numbers.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Stéphane GALLAND
- See Also:
- Serialized Form
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgeom
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.arakhne.afc.math.geometry.d2.afp.OrientedRectangle2afp
OrientedRectangle2afp.AbstractOrientedRectanglePathIterator<T extends PathElement2afp>, OrientedRectangle2afp.OrientedRectanglePathIterator<T extends PathElement2afp>, OrientedRectangle2afp.ProjectionToOrientedRectangleLocalCoordinateSystemPathIterator<T extends PathElement2afp>, OrientedRectangle2afp.TransformedOrientedRectanglePathIterator<T extends PathElement2afp>
-
Nested classes/interfaces inherited from interface org.arakhne.afc.math.geometry.d2.afp.Parallelogram2afp
Parallelogram2afp.AbstractParallelogramPathIterator<T extends PathElement2afp>, Parallelogram2afp.ParallelogramPathIterator<T extends PathElement2afp>, Parallelogram2afp.ProjectionToParallelogramLocalCoordinateSystemPathIterator<T extends PathElement2afp>, Parallelogram2afp.TransformedParallelogramPathIterator<T extends PathElement2afp>
-
Nested classes/interfaces inherited from interface org.arakhne.afc.math.geometry.d2.afp.Rectangle2afp
Rectangle2afp.RectanglePathIterator<T extends PathElement2afp>, Rectangle2afp.TransformedRectanglePathIterator<T extends PathElement2afp>
-
-
Constructor Summary
Constructors Constructor Description Rectangle2d()Construct an empty rectangle.Rectangle2d(double x, double y, double width, double height)Construct a rectangle with the given minimum corner and sizes.Rectangle2d(Rectangle2d rectangle)Constructor by copy.Rectangle2d(Point2D<?,?> min, Point2D<?,?> max)Construct a rectangle with the given minimum and maxium corners.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetMaxX()Replies the max x.doublegetMaxY()Replies the max y.doublegetMinX()Replies the min X.doublegetMinY()Replies the min y.inthashCode()voidsetFromCorners(double x1, double y1, double x2, double y2)Change the frame of the rectangle conserving previous min and max if needed.voidsetMaxX(double x)Set the max X conserving previous max if needed.voidsetMaxY(double y)Set the max Y conserving previous max if needed.voidsetMinX(double x)Set the min X conserving previous min if needed.voidsetMinY(double y)Set the min Y conserving previous min if needed.-
Methods inherited from class org.arakhne.afc.math.geometry.d2.d.AbstractShape2d
addShapeGeometryChangeListener, clone, equals, fireGeometryChange, getGeomFactory, removeShapeGeometryChangeListener, toJson, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.OrientedRectangle2afp
rotate, set, set
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.Parallelogram2afp
isCCW, set, setCenter, setFirstAxis, setFirstAxis, setFirstAxis, setFromPointCloud, setSecondAxis, setSecondAxis, setSecondAxis
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.Rectangle2afp
add, add, avoidCollisionWith, avoidCollisionWith, clear, contains, contains, createIntersection, createUnion, equalsToShape, getCenter, getCenterX, getCenterY, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getDistanceL1, getDistanceLinf, getDistanceSquared, getDistanceSquared, getFarthestPointTo, getFirstAxis, getFirstAxisExtent, getFirstAxisX, getFirstAxisY, getPathIterator, getSecondAxis, getSecondAxisExtent, getSecondAxisX, getSecondAxisY, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, isEmpty, set, set, setCenter, setCenterX, setCenterY, setFirstAxis, setFirstAxisExtent, setFromPointCloud, setIntersection, setSecondAxis, setSecondAxisExtent, setUnion, toBoundingBox, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.RectangularShape2afp
getHeight, getWidth, inflate, set, set, setFromCenter, setFromCenter, setFromCorners, setHeight, setWidth
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.Shape2afp
contains, contains, createTransformedShape, getClosestPointTo, getClosestPointTo, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getGeomFactory, intersects, intersects, toBoundingBox, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.Shape2D
clone, equalsToPathIterator, getDistance, getDistance, getPathIterator, operator_add, operator_and, operator_and, operator_minus, operator_multiply, operator_plus, operator_remove, operator_upTo
-
-
-
-
Constructor Detail
-
Rectangle2d
public Rectangle2d()
Construct an empty rectangle.
-
Rectangle2d
public Rectangle2d(Point2D<?,?> min, Point2D<?,?> max)
Construct a rectangle with the given minimum and maxium corners.- Parameters:
min- is the min corner of the rectangle.max- is the max corner of the rectangle.
-
Rectangle2d
public Rectangle2d(double x, double y, double width, double height)Construct a rectangle with the given minimum corner and sizes.- Parameters:
x- x coordinate of the minimum corner.y- y coordinate of the minimum corner.width- width of the rectangle.height- height of the rectangle.
-
Rectangle2d
public Rectangle2d(Rectangle2d rectangle)
Constructor by copy.- Parameters:
rectangle- the rectangle to copy.
-
-
Method Detail
-
setFromCorners
public void setFromCorners(double x1, double y1, double x2, double y2)Description copied from interface:RectangularShape2afpChange the frame of the rectangle conserving previous min and max if needed.- Specified by:
setFromCornersin interfaceRectangularShape2afp<Shape2d<?>,Rectangle2d,PathElement2d,Point2d,Vector2d,Rectangle2d>- Parameters:
x1- is the coordinate of the first corner.y1- is the coordinate of the first corner.x2- is the coordinate of the second corner.y2- is the coordinate of the second corner.
-
getMinX
@Pure public double getMinX()
Description copied from interface:RectangularShape2afpReplies the min X.- Specified by:
getMinXin interfaceRectangularShape2afp<Shape2d<?>,Rectangle2d,PathElement2d,Point2d,Vector2d,Rectangle2d>- Returns:
- the min x.
-
setMinX
public void setMinX(double x)
Description copied from interface:RectangularShape2afpSet the min X conserving previous min if needed.- Specified by:
setMinXin interfaceRectangularShape2afp<Shape2d<?>,Rectangle2d,PathElement2d,Point2d,Vector2d,Rectangle2d>- Parameters:
x- the min x.
-
getMaxX
@Pure public double getMaxX()
Description copied from interface:RectangularShape2afpReplies the max x.- Specified by:
getMaxXin interfaceRectangularShape2afp<Shape2d<?>,Rectangle2d,PathElement2d,Point2d,Vector2d,Rectangle2d>- Returns:
- the max x.
-
setMaxX
public void setMaxX(double x)
Description copied from interface:RectangularShape2afpSet the max X conserving previous max if needed.- Specified by:
setMaxXin interfaceRectangularShape2afp<Shape2d<?>,Rectangle2d,PathElement2d,Point2d,Vector2d,Rectangle2d>- Parameters:
x- the max x.
-
getMinY
@Pure public double getMinY()
Description copied from interface:RectangularShape2afpReplies the min y.- Specified by:
getMinYin interfaceRectangularShape2afp<Shape2d<?>,Rectangle2d,PathElement2d,Point2d,Vector2d,Rectangle2d>- Returns:
- the min y.
-
setMinY
public void setMinY(double y)
Description copied from interface:RectangularShape2afpSet the min Y conserving previous min if needed.- Specified by:
setMinYin interfaceRectangularShape2afp<Shape2d<?>,Rectangle2d,PathElement2d,Point2d,Vector2d,Rectangle2d>- Parameters:
y- the min y.
-
getMaxY
@Pure public double getMaxY()
Description copied from interface:RectangularShape2afpReplies the max y.- Specified by:
getMaxYin interfaceRectangularShape2afp<Shape2d<?>,Rectangle2d,PathElement2d,Point2d,Vector2d,Rectangle2d>- Returns:
- the max y.
-
setMaxY
public void setMaxY(double y)
Description copied from interface:RectangularShape2afpSet the max Y conserving previous max if needed.- Specified by:
setMaxYin interfaceRectangularShape2afp<Shape2d<?>,Rectangle2d,PathElement2d,Point2d,Vector2d,Rectangle2d>- Parameters:
y- the max y.
-
hashCode
@Pure public int hashCode()
- Specified by:
hashCodein classAbstractShape2d<Rectangle2d>
-
-