|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--raja.Vector3D
The Vector3D class defines a high precision vector in the 3
dimensional space, given by its 3D coordinates. This class provides
most of the classical operations on vectors (norm, dot product, cross
product, projection...).
Point3D, Serialized Form| Field Summary | |
double |
x
The x coordinate. |
double |
y
The y coordinate. |
double |
z
The z coordinate. |
| Constructor Summary | |
Vector3D(double x,
double y,
double z)
Creates a Vector3D object initialized with the
specified 3D coordinates. |
|
Vector3D(Point3D source,
Point3D dest)
Initializes a newly created Vector3D object so that it
represents the vector connecting the two specified 3D points. |
|
Vector3D(Vector3D v)
Initializes a newly created Vector3D object so that it
represents the same 3 dimensional vector as the argument. |
|
| Method Summary | |
static Object |
build(ObjectReader reader)
Creates a Vector3D object from the specified
ObjectReader. |
static Vector3D |
crossProduct(Vector3D v1,
Vector3D v2)
Computes the cross product of the two specified Vector3D. |
static double |
dotProduct(Vector3D v1,
Vector3D v2)
Computes the dot product of the two specified Vector3D. |
double |
norm()
Computes the norm of this Vector3D. |
static Vector3D |
normalization(Vector3D v)
Computes a normed version of the specified Vector3D. |
double |
normSq()
Computes the square of the norm of this Vector3D. |
static Vector3D |
opposite(Vector3D v)
Computes the opposite of the specified Vector3D. |
static Vector3D |
product(Vector3D v,
double f)
Computes the product of the specified Vector3D
with the specified double factor. |
static Vector3D |
projection(Vector3D v,
Vector3D n)
Computes the projection of the specified Vector3D
on the hyperplane given by the specified normal. |
static Vector3D |
sum(Vector3D v1,
Vector3D v2)
Computes the sum of the two specified Vector3D. |
String |
toString()
Returns a textual String representation of this
Vector3D object. |
void |
write(ObjectWriter writer)
Writes the contents of this Vector3D object to the
specified ObjectWriter. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public double x
public double y
public double z
| Constructor Detail |
public Vector3D(double x,
double y,
double z)
Vector3D object initialized with the
specified 3D coordinates.x, y, z - the coordinates to which to set the newly
constructed Vector3D.public Vector3D(Vector3D v)
Vector3D object so that it
represents the same 3 dimensional vector as the argument. In other
words, the newly created Vector3D is a copy of the
specified Vector3D.p - a Vector3D object.
public Vector3D(Point3D source,
Point3D dest)
Vector3D object so that it
represents the vector connecting the two specified 3D points.source - the source Point3D.dest - the destination Point3D.| Method Detail |
public static Object build(ObjectReader reader)
throws IOException
Vector3D object from the specified
ObjectReader.reader - the ObjectReader to read the
fields from.public double norm()
Vector3D.Vector3D.public double normSq()
Vector3D.Vector3D.public static Vector3D normalization(Vector3D v)
Vector3D.
The norm of the Vector3D argument is assumed to be non
zero.v - a Vector3D object, whose norm is non zero.Vector3D.
public static double dotProduct(Vector3D v1,
Vector3D v2)
Vector3D.v1, v2 - the two Vector3D to dot product.Vector3D.
public static Vector3D product(Vector3D v,
double f)
Vector3D
with the specified double factor.v - the Vector3D product with.f - the double factor.Vector3D that is the product of
the specified Vector3D with the specified double factor.
public static Vector3D crossProduct(Vector3D v1,
Vector3D v2)
Vector3D.v1, v2 - the two Vector3D to cross product.Vector3D that is the cross
product of the two specified Vector3D.
public static Vector3D sum(Vector3D v1,
Vector3D v2)
Vector3D.v1, v2 - the two Vector3D to sum.Vector3D that is the sum of the
two specified Vector3D.public static Vector3D opposite(Vector3D v)
Vector3D.v - the Vector3D to compute the opposite of.Vector3D that is the
opposite of the specified Vector3D.
public static Vector3D projection(Vector3D v,
Vector3D n)
Vector3D
on the hyperplane given by the specified normal.v - the Vector3D project.n - the normal of the hyperplane to project the specified
Vector3D on.Vector3D that is the projection
of the specified Vector3D on the hyperplane given by the
specified normal.public String toString()
String representation of this
Vector3D object.toString in class Object
public void write(ObjectWriter writer)
throws IOException
Vector3D object to the
specified ObjectWriter.write in interface Writablewriter - the ObjectWriter to write the
fields to.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||