geometry
Class Coordinates3D

java.lang.Object
  extended by geometry.Coordinates2D
      extended by geometry.Coordinates3D
All Implemented Interfaces:
Coordinates

public class Coordinates3D
extends Coordinates2D

data structure to hold 3D coordinates, extending the 2D coordinates strucure by a valid z-coordinate Coordinates


Field Summary
private  double z
          z-coordinate
 
Constructor Summary
Coordinates3D(double x, double y, double z)
          constructor.
 
Method Summary
 boolean equals(Coordinates coordinates)
          test if two coordinates3D are equal.
 double getDistance(Coordinates coordinates)
          get the distance between two coordinates.
 double getZ()
          get z-coordinate
 void setZ(double z)
          set z-coordinate
 java.lang.String toString()
           
 
Methods inherited from class geometry.Coordinates2D
getX, getY, isNeighbor, setX, setY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

z

private double z
z-coordinate

Constructor Detail

Coordinates3D

public Coordinates3D(double x,
                     double y,
                     double z)
constructor. creating new coordinates with specified x,y, and z coordinate

Parameters:
x - x-coordinate
y - y-coordinate
z - z-coordinate
Method Detail

equals

public boolean equals(Coordinates coordinates)
test if two coordinates3D are equal. they are equal if x, y, and z coordinate are equal

Specified by:
equals in interface Coordinates
Overrides:
equals in class Coordinates2D
Parameters:
coordinates -
Returns:
true if all coordinate components (x,y,z) are equal, false if not

getZ

public double getZ()
get z-coordinate

Specified by:
getZ in interface Coordinates
Overrides:
getZ in class Coordinates2D
Returns:
z

setZ

public void setZ(double z)
set z-coordinate

Specified by:
setZ in interface Coordinates
Overrides:
setZ in class Coordinates2D
Parameters:
z -

getDistance

public double getDistance(Coordinates coordinates)
Description copied from interface: Coordinates
get the distance between two coordinates.

Specified by:
getDistance in interface Coordinates
Overrides:
getDistance in class Coordinates2D
Parameters:
coordinates - the coordinates to get the distance from
Returns:
the distance between this object's coordinates and the parameter

toString

public java.lang.String toString()
Overrides:
toString in class Coordinates2D