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()
Header for ascii input.
|
byte[] |
binaryHeader()
Header for binary input.
|
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)
Read internal state from in.
|
void |
readBinary(DataInput in)
Read internal state from 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)
Write the content of this as ascii to out.
|
void |
writeBinary(DataOutput out)
Write the content of this as binary to 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)
Point3d
public void setY(double y)
Point3d
public void setZ(double z)
Point3d
public void copyFrom(Point3d p)
Point3d
public Point3dImpl clone()
public Double getOrdinate(int dimension)
Coordinate
getOrdinate
in interface Coordinate
dimension
- The index of the dimension we are interested inpublic int getDimensions()
getDimensions
in interface Coordinate
public void translate(double x, double y, double z)
Point3d
public void translate(Point3d v)
Point3d
public Point3dImpl transform(Jama.Matrix transform)
Point3d
public Point3d minus(Point3d a)
Point3d
public void readASCII(Scanner in) throws IOException
ReadableASCII
readASCII
in interface ReadableASCII
in
- source to read from.IOException
- an error reading inputpublic String asciiHeader()
ReadableASCII
asciiHeader
in interface ReadableASCII
asciiHeader
in interface WriteableASCII
public void readBinary(DataInput in) throws IOException
ReadableBinary
readBinary
in interface ReadableBinary
in
- source to read from.IOException
- an error reading inputpublic byte[] binaryHeader()
ReadableBinary
binaryHeader
in interface ReadableBinary
binaryHeader
in interface WriteableBinary
public void writeASCII(PrintWriter out) throws IOException
WriteableASCII
writeASCII
in interface WriteableASCII
out
- sink to write toIOException
- an error writing to outpublic void writeBinary(DataOutput out) throws IOException
WriteableBinary
writeBinary
in interface WriteableBinary
out
- sink to write toIOException
- an error writing to outpublic Point3dImpl copy()
Point3d
public static Point3d createRandomPoint()
public void setOrdinate(int dimension, Number value)
Coordinate
setOrdinate
in interface Coordinate
dimension
- The index of the dimension we are interested invalue
- The value of the ordinate of the given dimension.