|
HOME | PROJECTS | REALITY | EMAIL |
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--ReVector3D
Name: class ReVector3D Desc: vector math
| Constructor Summary | |
ReVector3D()
constructor that creates a <0,0,0> vector. |
|
ReVector3D(double dX,
double dY)
constructor, specifying initial x and y coordinates, z is 0. |
|
ReVector3D(double dX,
double dY,
double dZ)
constructor specifying initial x, y, and z coordinates |
|
| Method Summary | |
void |
add(ReVector3D v)
Adds another vector to this vector. |
java.lang.Object |
clone()
clones the vector |
void |
copy(ReVector3D v)
copy other vector into this one |
ReVector3D |
cross(ReVector3D v)
Calculates the cross product of this vector and the one passed to it. |
double |
dot(ReVector3D v)
Calculates the dot product of this vector and another |
boolean |
equals(ReVector3D v)
Tests whether or not two vectors are identical in respect to x,y,z coordinates. |
double |
getOrientationAngleXY()
Return the XY orientation in radians. |
double |
getX()
retrieves the x component |
double |
getY()
retrieves the y component |
double |
getZ()
retrieves the z component |
double |
magnitude()
Reports the magnitude of this vector |
double |
magnitudeSquared()
Reports the magnitude of this vector squred |
ReVector3D |
minus(ReVector3D v)
Subtracts a vector from this one and returns the result. |
void |
normalize()
Normalizes vector |
ReVector3D |
plus(ReVector3D v)
Adds this vector and another and returns the result. |
void |
rotateXY(double dRadians)
Rotate vector |
ReVector3D |
scale(double dScalar)
Multiplies this vector by a scalar and keeps the result. |
void |
setOrientationAngleXY(double angle)
Sets the XY orientation. |
double |
setX(double dNewX)
sets x component |
void |
setXY(double dNewX,
double dNewY)
sets x and y component |
void |
setXYZ(double dNewX,
double dNewY,
double dNewZ)
sets x, y, and z component |
double |
setY(double dNewY)
sets y component |
double |
setZ(double dNewZ)
sets z component |
void |
subtract(ReVector3D v)
Subtracts argument vector from this vector. |
ReVector3D |
times(double dScalar)
Multiplies this vector by a scalar and returns the result. |
java.awt.Point |
toPoint()
|
java.lang.String |
toString()
Returns a string representation of the vector. |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public ReVector3D(double dX,
double dY,
double dZ)
dX - x coordinatedY - y coordinatedZ - z coordinate
public ReVector3D(double dX,
double dY)
dX - x coordinatedY - y coordinatepublic ReVector3D()
| Method Detail |
public void copy(ReVector3D v)
v - a 3d vectorpublic void add(ReVector3D v)
v - a 3d vectorpublic double dot(ReVector3D v)
v - a 3d vector to dot withpublic ReVector3D cross(ReVector3D v)
v - a 3d vector to cross withpublic final double getX()
public final double getY()
public final double getZ()
public double setX(double dNewX)
public double setY(double dNewY)
public double setZ(double dNewZ)
public void setXY(double dNewX,
double dNewY)
public void setXYZ(double dNewX,
double dNewY,
double dNewZ)
public double getOrientationAngleXY()
public void setOrientationAngleXY(double angle)
angle - orientation in radianspublic ReVector3D plus(ReVector3D v)
v - a 3d vectorpublic ReVector3D minus(ReVector3D v)
v - a 3d vectorpublic ReVector3D times(double dScalar)
dScalar - a scalar (double) to multiply withpublic ReVector3D scale(double dScalar)
dScalar - a scalar to multiplypublic void rotateXY(double dRadians)
public void normalize()
public double magnitude()
public double magnitudeSquared()
public boolean equals(ReVector3D v)
v - another ReVector3Dpublic void subtract(ReVector3D v)
v - a 3d vectorpublic java.lang.String toString()
public java.lang.Object clone()
public java.awt.Point toPoint()
|
HOME | PROJECTS | REALITY | EMAIL |
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||