public class Point3dImpl extends Object implements Point3d, Cloneable
| Modifier and Type | Field and Description |
|---|---|
double |
x
The x-ordinate
|
double |
y
The y-ordinate
|
double |
z
The z-ordinate
|
| Constructor and Description |
|---|
Point3dImpl()
Construct a Point3dImpl at the origin.
|
Point3dImpl(double[] array)
Construct a Point3dImpl with the given (x, y, z) coordinates packed into
an array
|
Point3dImpl(double x,
double y,
double z)
Construct a Point3dImpl with the given (x, y, z) coordinates
|
Point3dImpl(Point3d p)
Construct a Point3dImpl with the (x,y,z) coordinates given via another
point.
|
| Modifier and Type | Method and Description |
|---|---|
String |
asciiHeader() |
byte[] |
binaryHeader() |
Point3dImpl |
clone() |
Point3dImpl |
copy()
Clone the point
|
void |
copyFrom(Point3d p)
Copy the values of the given point into this point.
|
static Point3d |
createRandomPoint()
Create a random point in ([0..1], [0..1], [0..1]).
|
boolean |
equals(Object o) |
int |
getDimensions() |
Double |
getOrdinate(int dimension)
Get the ordinate value for a specific dimension.
|
double |
getX() |
double |
getY() |
double |
getZ() |
int |
hashCode() |
Point3d |
minus(Point3d a)
Take point point from another point such that return = this - a
|
void |
readASCII(Scanner in) |
void |
readBinary(DataInput in) |
void |
setOrdinate(int dimension,
Number value)
Set the ordinate value for a specific dimension.
|
void |
setX(double x)
Set x coordinate of point
|
void |
setY(double y)
Set y coordinate of point
|
void |
setZ(double z)
Set z coordinate of point
|
String |
toString() |
Point3dImpl |
transform(Jama.Matrix transform)
Transform the point by the given matrix
|
void |
translate(double x,
double y,
double z)
Translate the position of the point by the given amounts
|
void |
translate(Point3d v)
Translate the position of the point by the given amounts
|
void |
writeASCII(PrintWriter out) |
void |
writeBinary(DataOutput out) |
public double x
public double y
public double z
public Point3dImpl(double x, double y, double z)
x - x-ordinatey - y-ordinatez - z-ordinatepublic Point3dImpl(double[] array)
array - the coordinates ([x, y, z])public Point3dImpl(Point3d p)
p - The point to copy from.public Point3dImpl()
public void setX(double x)
Point3dpublic void setY(double y)
Point3dpublic void setZ(double z)
Point3dpublic void copyFrom(Point3d p)
Point3dpublic Point3dImpl clone()
public Double getOrdinate(int dimension)
CoordinategetOrdinate in interface Coordinatedimension - The index of the dimension we are interested inpublic int getDimensions()
getDimensions in interface Coordinatepublic void translate(double x, double y, double z)
Point3dpublic void translate(Point3d v)
Point3dpublic Point3dImpl transform(Jama.Matrix transform)
Point3dpublic Point3d minus(Point3d a)
Point3dpublic void readASCII(Scanner in) throws IOException
readASCII in interface ReadableASCIIIOExceptionpublic String asciiHeader()
asciiHeader in interface ReadableASCIIasciiHeader in interface WriteableASCIIpublic void readBinary(DataInput in) throws IOException
readBinary in interface ReadableBinaryIOExceptionpublic byte[] binaryHeader()
binaryHeader in interface ReadableBinarybinaryHeader in interface WriteableBinarypublic void writeASCII(PrintWriter out) throws IOException
writeASCII in interface WriteableASCIIIOExceptionpublic void writeBinary(DataOutput out) throws IOException
writeBinary in interface WriteableBinaryIOExceptionpublic Point3dImpl copy()
Point3dpublic static Point3d createRandomPoint()
public void setOrdinate(int dimension, Number value)
CoordinatesetOrdinate in interface Coordinatedimension - The index of the dimension we are interested invalue - The value of the ordinate of the given dimension.