|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.chemistry.gui.extended.geometry.GeoVector3D
public class GeoVector3D
A geometric vector class that provides vector computations: length, normalize, dot and cross. note: Vector is a coordinate independent concept. Translating a vector in 3D (or 2D) space yields the same vector.
Point3D| Field Summary | |
|---|---|
protected double |
x
X component of the vector |
protected double |
y
Y component of the vector |
protected double |
z
Z component of the vector |
| Constructor Summary | |
|---|---|
GeoVector3D()
Default constructor, all component are 0.0 |
|
GeoVector3D(double x,
double y,
double z)
Full constructor |
|
GeoVector3D(GeoVector3D gv)
copy constructor |
|
GeoVector3D(Point3D p1,
Point3D p2)
constructor |
|
| Method Summary | |
|---|---|
void |
add(GeoVector3D gv)
add a vector to this vector |
GeoVector3D |
cross(GeoVector3D gv)
cross product with another vector |
double |
dot(GeoVector3D gv)
dot product with another vector |
double |
getX()
Return component x |
double |
getY()
Return component y |
double |
getZ()
Return component z |
double |
length()
calculate the length of the vector |
void |
minus(GeoVector3D gv)
subtract a vector from this vector |
void |
normalize()
change the vector's length so that it becomes a unit vector |
void |
scale(double factor)
scale the vector by a factor |
void |
setX(double x)
Set component x |
void |
setY(double y)
Set component y |
void |
setZ(double z)
Set component z |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected double x
protected double y
protected double z
| Constructor Detail |
|---|
public GeoVector3D()
public GeoVector3D(double x,
double y,
double z)
x - DOCUMENT ME!y - DOCUMENT ME!z - DOCUMENT ME!
public GeoVector3D(Point3D p1,
Point3D p2)
p1 - start point of the vectorp2 - end point of the vectorpublic GeoVector3D(GeoVector3D gv)
gv - the vector to be copied| Method Detail |
|---|
public double length()
public void normalize()
public GeoVector3D cross(GeoVector3D gv)
gv - the other vector to cross
public double dot(GeoVector3D gv)
gv - the other vector to dot
public void scale(double factor)
factor - the scaling factorpublic void add(GeoVector3D gv)
gv - the other vector to addpublic void minus(GeoVector3D gv)
gv - the other vector to subtractpublic double getX()
public double getY()
public double getZ()
public void setX(double x)
x - x componentpublic void setY(double y)
y - y componentpublic void setZ(double z)
z - z component
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||