de.unihalle.informatik.MiToBo.core.datatypes

## Class MTBPoint3D

• All Implemented Interfaces:
Comparable<MTBPoint3D>

```@ALDParametrizedClass
public class MTBPoint3D
extends Object
implements 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

Fields
Modifier and Type Field and Description
`double` `x`
Point coordinate at x-dimension.
`double` `y`
Point coordinate at y-dimension.
`double` `z`
Point coordinate at z-dimension.
• ### Constructor Summary

Constructors
Constructor and Description
`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

All Methods
Modifier and Type Method and Description
`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(Object obj)`
`double` `getX()`
Return coordinate of x-dimension.
`double` `getY()`
Return coordinate of y-dimension.
`double` `getZ()`
Return coordinate of z-dimension.
`int` `hashCode()`
`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, notify, notifyAll, toString, wait, wait, wait`
• ### Field Detail

• #### x

```@ALDClassParameter(label="x coordinate")
public double x```
Point coordinate at x-dimension.
• #### y

```@ALDClassParameter(label="y coordinate")
public double y```
Point coordinate at y-dimension.
• #### z

```@ALDClassParameter(label="z coordinate")
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

• #### toXMLType

`public de.unihalle.informatik.MiToBo_xml.MTBXMLPoint3DType toXMLType()`
Generate xml-representation of this 3D-point.
• #### 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.
• #### 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
• #### 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
• #### 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
• #### 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.
• #### 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.
• #### compareTo

`public int compareTo(MTBPoint3D q)`
Specified by:
`compareTo` in interface `Comparable<MTBPoint3D>`
• #### equals

`public boolean equals(Object obj)`
Overrides:
`equals` in class `Object`
• #### hashCode

`public int hashCode()`
Overrides:
`hashCode` in class `Object`