|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgeometry.Coordinates2D
public class Coordinates2D
Coordinates2D holds information about two-dimensional coordinates (x and y coordinate). access to the z-coordinate has to be provided, as interface demands this, but is always substituted by 0.
| Field Summary | |
|---|---|
private double |
x
the x coordinate |
private double |
y
the y coordinate |
| Constructor Summary | |
|---|---|
Coordinates2D(double x,
double y)
constructor. |
|
| Method Summary | |
|---|---|
boolean |
equals(Coordinates coordinates)
test if two coordinates are equal, that is, all of their components are equal. |
double |
getDistance(Coordinates coordinates)
get the distance between two coordinates. |
double |
getX()
get x coordinate |
double |
getY()
get y coordinate |
double |
getZ()
get z coordinate |
boolean |
isNeighbor(Coordinates coordinates)
check if the coordinates specified by the parameter are neighbor coordinates. |
void |
setX(double x)
set x coordinate |
void |
setY(double y)
set y coordinate |
void |
setZ(double z)
set z coordinate |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private double x
private double y
| Constructor Detail |
|---|
public Coordinates2D(double x,
double y)
x - y - | Method Detail |
|---|
public boolean equals(Coordinates coordinates)
Coordinates
equals in interface Coordinatespublic double getDistance(Coordinates coordinates)
Coordinates
getDistance in interface Coordinatescoordinates - the coordinates to get the distance from
public double getX()
Coordinates
getX in interface Coordinatespublic double getY()
Coordinates
getY in interface Coordinatespublic double getZ()
Coordinates
getZ in interface Coordinatespublic void setX(double x)
Coordinates
setX in interface Coordinatespublic void setY(double y)
Coordinates
setY in interface Coordinatespublic void setZ(double z)
Coordinates
setZ in interface Coordinatespublic boolean isNeighbor(Coordinates coordinates)
Coordinates
isNeighbor in interface Coordinatescoordinates - the coordinates to check neighborhood to
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||