de.unihalle.informatik.MiToBo.core.datatypes
Class MTBPoint3D

java.lang.Object
  extended by de.unihalle.informatik.MiToBo.core.datatypes.MTBPoint3D
All Implemented Interfaces:
java.lang.Comparable<MTBPoint3D>

public class MTBPoint3D
extends java.lang.Object
implements java.lang.Comparable<MTBPoint3D>

The Point3D class defines a point representing a location in (x, y, z) coordinate space. The coordinates are specified in double precision.

Author:
glass

Field Summary
 double x
          Point coordinate at x-dimension.
 double y
          Point coordinate at y-dimension.
 double z
          Point coordinate at z-dimension.
 
Constructor Summary
MTBPoint3D()
          Standardconstructor to create an new empty 3D point object.
MTBPoint3D(double x, double y, double z)
          Construct a new 3D point with the given coordinates.
MTBPoint3D(MTBPoint3D p)
          Construct a new 3D point from the given 3D point.
MTBPoint3D(de.unihalle.informatik.MiToBo_xml.MTBXMLPoint3DType p)
          Construct a new MTBPoint3D from a 3D-point object constructed from xml-representation.
 
Method Summary
 int compareTo(MTBPoint3D q)
           
 double distance(double px, double py, double pz)
          Compute the Euclidean distance between this 3D point object and the given location.
 double distance(MTBPoint3D p)
          Compute the Euclidean distance between this 3D point object and the given 3D point object.
 boolean equals(java.lang.Object obj)
           
 double getX()
          Return coordinate of x-dimension.
 double getY()
          Return coordinate of y-dimension.
 double getZ()
          Return coordinate of z-dimension.
 void setLocation(double x, double y, double z)
          Set coordinates of current 3D point object.
 void setX(double x)
          Set coordinate of x-dimension.
 void setY(double y)
          Set coordinate of y-dimension.
 void setZ(double z)
          Set coordinate of z-dimension.
 de.unihalle.informatik.MiToBo_xml.MTBXMLPoint3DType toXMLType()
          Generate xml-representation of this 3D-point.
 void translate(double x, double y, double z)
          Translate current coordinates of the 3D point object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public double x
Point coordinate at x-dimension.


y

public double y
Point coordinate at y-dimension.


z

public double z
Point coordinate at z-dimension.

Constructor Detail

MTBPoint3D

public MTBPoint3D()
Standardconstructor to create an new empty 3D point object.


MTBPoint3D

public MTBPoint3D(double x,
                  double y,
                  double z)
Construct a new 3D point with the given coordinates.

Parameters:
x - coordinate for x-dimension
y - coordinate for y-dimension
z - coordinate for z-dimension

MTBPoint3D

public MTBPoint3D(MTBPoint3D p)
Construct a new 3D point from the given 3D point.

Parameters:
p - 3D point

MTBPoint3D

public MTBPoint3D(de.unihalle.informatik.MiToBo_xml.MTBXMLPoint3DType p)
Construct a new MTBPoint3D from a 3D-point object constructed from xml-representation.

Parameters:
p - 3D-point in xml-representation
Method Detail

compareTo

public int compareTo(MTBPoint3D q)
Specified by:
compareTo in interface java.lang.Comparable<MTBPoint3D>

distance

public double distance(double px,
                       double py,
                       double pz)
Compute the Euclidean distance between this 3D point object and the given location.

Parameters:
px - x-coordinate of the location
py - y-coordinate of the location
pz - z-coordinate of the location
Returns:
Distance between this 3D point object and the given location.

distance

public double distance(MTBPoint3D p)
Compute the Euclidean distance between this 3D point object and the given 3D point object.

Parameters:
p - 3D point object
Returns:
Distance between this 3D point object and the given 3D point.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getX

public double getX()
Return coordinate of x-dimension.

Returns:
x-coordinate.

getY

public double getY()
Return coordinate of y-dimension.

Returns:
y-coordinate.

getZ

public double getZ()
Return coordinate of z-dimension.

Returns:
z-coordinate.

setLocation

public void setLocation(double x,
                        double y,
                        double z)
Set coordinates of current 3D point object.

Parameters:
x - coordinate of x-dimension
y - coordinate of y-dimension
z - coordinate of z-dimension

setX

public void setX(double x)
Set coordinate of x-dimension.

Parameters:
x - x-coordinate

setY

public void setY(double y)
Set coordinate of y-dimension.

Parameters:
y - y-coordinate

setZ

public void setZ(double z)
Set coordinate of z-dimension.

Parameters:
z - z-coordinate

toXMLType

public de.unihalle.informatik.MiToBo_xml.MTBXMLPoint3DType toXMLType()
Generate xml-representation of this 3D-point.


translate

public void translate(double x,
                      double y,
                      double z)
Translate current coordinates of the 3D point object. Given values will be added to each coordinate.

Parameters:
x - value to ad at x-coordinate
y - value to ad at y-coordinate
z - value to ad at z-coordinate