|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.proteinshader.math.Point3d
public class Point3d
This class is used to create a point with 3 elements of type double.
The Point3f class is nearly identical, except that it happens to use
floats rather than doubles.
The x, y, and z attributes have been made public because this class
is primarily only a data structure (although there are a few methods
for doing basic point operations).
Field Summary | |
---|---|
static String |
DECIMAL_FORMAT
As a convienence for debugging, the toString() method will return a representation of a point in the general form "(x, y, z)", where the number of decimal places for each value will be determined this decimal format String, which is "0.000". |
double |
x
The public x-coordinate of this three element point. |
double |
y
The public y-coordinate of this three element point. |
double |
z
The public z-coordinate of this three element point. |
Constructor Summary | |
---|---|
Point3d()
Constructs a Point3d at the origin. |
|
Point3d(double x,
double y,
double z)
Constructs a point with the requested xyz-coordinates. |
Method Summary | |
---|---|
Point3d |
add(Vec3d vec)
Returns the point created by adding the vector given as an argument to the point that is the calling object. |
void |
addToMe(Vec3d vec)
Tranlates the calling Point3d by adding the vector xyz-coordinates to it. |
Point3d |
clone()
Returns a clone of this point. |
Vec3d |
minus(Point3d point)
Returns the direction vector obtained by subtracting the point given as an argument from the calling point. |
void |
setXYZ(double x,
double y,
double z)
Sets the xyz-values of the point. |
String |
toString()
As a convenience for debugging, the toString() method returns the xyz-coordinates of the point in the form "(x, y, z)". |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String DECIMAL_FORMAT
public double x
public double y
public double z
Constructor Detail |
---|
public Point3d()
public Point3d(double x, double y, double z)
x
- the x-coordinate.y
- the y-coordinate.z
- the z-coordinate.Method Detail |
---|
public Point3d add(Vec3d vec)
vec
- rgw vector to translate the point by.
public void addToMe(Vec3d vec)
vec
- the vector to translate the point by.public Point3d clone()
clone
in class Object
public Vec3d minus(Point3d point)
point
- The point to subtract from the calling point.
public void setXYZ(double x, double y, double z)
x
- the x-coordinate.y
- the y-coordinate.z
- the z-coordinate.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |