|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HavingCenter extends Item
Item which has a geometrical center. Only such items can be moved as a result of physical interaction.
Some items, like Earth
or BunkerWall
, have no center and cannot be moved —
but can act to another items.
AlgART Laboratory 2010
Modifier and Type | Method and Description |
---|---|
double |
getCenterX()
Returns x-coordinate of the item's center. |
double |
getCenterY()
Returns y-coordinate of the item's center. |
double |
getCenterZ()
Returns z-coordinate of the item's center. |
boolean |
isInfinite()
Returns true if at least one of 3 coordinates of the item's center is Double.POSITIVE_INFINITY or Double.NEGATIVE_INFINITY. |
boolean |
isNaN()
Returns true if at least one of 3 coordinates of the item's center is NaN. |
void |
setCenter(double x,
double y,
double z)
Sets all coordinates of the item's center. |
void |
setCenterX(double x)
Sets x-coordinate of the item's center. |
void |
setCenterY(double y)
Sets y-coordinate of the item's center. |
void |
setCenterZ(double z)
Sets z-coordinate of the item's center. |
double |
squareOfDistance(HavingCenter other)
Returns the square of the distance between this item's center and the center of the specified item. |
Method Detail |
---|
double getCenterX()
double getCenterY()
double getCenterZ()
void setCenterX(double x)
x
- new x-coordinate of the new item's center.void setCenterY(double y)
y
- new y-coordinate of the new item's center.void setCenterZ(double z)
z
- new z-coordinate of the new item's center.void setCenter(double x, double y, double z)
x
- new x-coordinate of the new item's center.y
- new y-coordinate of the new item's center.z
- new z-coordinate of the new item's center.boolean isNaN()
boolean isInfinite()
double squareOfDistance(HavingCenter other)
other
- some other item, which also has a center.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |