Package com.irurueta.geometry
Class Box<P extends Point<P>>
java.lang.Object
com.irurueta.geometry.Box<P>
- Type Parameters:
P- a point implementation.
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Box2D,Box3D,KDTree.BoxNode
Abstract representation of a box for a point in an n-dimensional representation.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublegetDistance(P point) Gets distance of provided point to the boundaries of this box or zero if the point is inside this box.getHi()Gets high coordinate values.getLo()Gets low coordinate values.doublegetSqrDistance(P point) Gets square distance of provided point to the boundaries of this box or zero if the point is inside this box.private voidinternalSetBounds(P lo, P hi) Internally sets boundaries.voidSets boundaries.voidSets high coordinate values.voidSets low coordinate values.private doublesqr(double value) Returns the squared value.
-
Field Details
-
lo
Low coordinate values. -
hi
High coordinate values.
-
-
Constructor Details
-
Box
protected Box()Empty constructor. -
Box
Constructor.- Parameters:
lo- low coordinate values.hi- high coordinate values.
-
-
Method Details
-
getLo
Gets low coordinate values.- Returns:
- low coordinate values.
-
setLo
Sets low coordinate values.- Parameters:
lo- low coordinate values.
-
getHi
Gets high coordinate values.- Returns:
- high coordinate values.
-
setHi
Sets high coordinate values.- Parameters:
hi- high coordinate values.
-
setBounds
Sets boundaries.- Parameters:
lo- low coordinate values.hi- high coordinate values.
-
getSqrDistance
Gets square distance of provided point to the boundaries of this box or zero if the point is inside this box.- Parameters:
point- point to be checked.- Returns:
- distance of provided point.
-
getDistance
Gets distance of provided point to the boundaries of this box or zero if the point is inside this box.- Parameters:
point- point to be checked.- Returns:
- distance of provided point.
-
sqr
private double sqr(double value) Returns the squared value.- Parameters:
value- value to be squared.- Returns:
- squared value.
-
internalSetBounds
Internally sets boundaries.- Parameters:
lo- low coordinate values.hi- high coordinate values.
-