|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectutil.Vector3D
public class Vector3D
This class allows storing 3-D vector components.
| Field Summary | |
|---|---|
double |
x
|
double |
y
|
double |
z
|
| Constructor Summary | |
|---|---|
Vector3D()
Creates a Vector3D object with (0, 0, 0) as the component values. |
|
Vector3D(double x,
double y,
double z)
Creates a Vector3D object with (x, y, and z) component values. |
|
Vector3D(Point3D point)
Creates a Vector3D object from a Point3D argument's component values. |
|
Vector3D(Vector3D vector)
Creates a Vector3D object from a Vector3D argument's component values. |
|
| Method Summary | |
|---|---|
Vector3D |
clone()
Creates a new Vector3D object from the Vector3D's component values. |
Vector3D |
crossProd(double x,
double y,
double z)
Returns the vector from the cross product with the given vector components. |
static Vector3D |
crossProd(double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
Returns the vector from the cross product of the two vector component triplets. |
Vector3D |
crossProd(Vector3D vector)
Returns the vector from the cross product with the given Vector3D. |
static Vector3D |
crossProd(Vector3D vector1,
Vector3D vector2)
Returns the vector from the cross product of the two vectors. |
Vector3D |
diff(double x,
double y,
double z)
Returns the difference between the two component vectors. |
static Vector3D |
diff(double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
Returns the difference between the two component vectors. |
Vector3D |
diff(Vector3D vector)
Returns the difference between the two Vector3D vectors. |
static Vector3D |
diff(Vector3D vector1,
Vector3D vector2)
Returns the difference between the two Vector3D vectors. |
double |
distance(double x,
double y,
double z)
Returns the distance from this Point3D to the specified coordinate. |
double |
distance(Point3D point)
Returns the distance from this Point3D to the specified Point3D. |
double |
distanceSQ(double x,
double y,
double z)
Returns the distance squared from this Point3D to the specified coordinate. |
static double |
distanceSQ(double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
Returns the distance squared between the two coordinate locations. |
double |
distanceSQ(Point3D point)
Returns the distance squared from this Point3D to the specified Point3D. |
double |
dotProd(double x,
double y,
double z)
Returns the scalar value of the dot product with the given vector components. |
static double |
dotProd(double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
Returns the scalar value of the dot product with the given vector components. |
double |
dotProd(Vector3D vector)
Returns the scalar value of the dot product with the given Vector3D. |
static double |
dotProd(Vector3D vector1,
Vector3D vector2)
Returns the vector dot product between the given Vector3D vectors. |
double |
getX()
Returns the X component of this Vector3D in double precision. |
double |
getY()
Returns the Y component of this Vector3D in double precision. |
double |
getZ()
Returns the Z component of this Vector3D in double precision. |
double |
magnitude()
Returns the Euclidian magnitude of the Vector3D. |
static double |
magnitude(double x,
double y,
double z)
Returns the Euclidean magnitude of these vector components |
boolean |
normalize()
Normalizes the vector. |
void |
Print()
Prints the representation the value of this Vector3D. |
Vector3D |
scale(double scale)
Returns the scaled vector. |
void |
setComponents(double x,
double y,
double z)
Sets the Vector3D component values to the x, y, and Z component values. |
void |
setLocation(Vector3D vector)
Sets the Vector3D object to the x, y, and Z component values of another vector. |
Vector3D |
sum(double x,
double y,
double z)
Returns the sum of the two component vectors. |
static Vector3D |
sum(double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
Returns the sum of the two component vectors. |
Vector3D |
sum(Vector3D vector)
Returns the sum of the two Vector3D vectors. |
static Vector3D |
sum(Vector3D vector1,
Vector3D vector2)
Returns the sum of the two Vector3D vectors. |
java.lang.String |
toString()
Returns a String that represents the value of this Vector3D. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public double x
public double y
public double z
| Constructor Detail |
|---|
public Vector3D()
public Vector3D(double x,
double y,
double z)
x - the x-component.y - the y-component.z - the z-component.public Vector3D(Vector3D vector)
vector - the other vector.public Vector3D(Point3D point)
point - the point.| Method Detail |
|---|
public Vector3D clone()
clone in class java.lang.Objectpublic double getX()
public double getY()
public double getZ()
public void setComponents(double x,
double y,
double z)
x - the x-component.y - the y-component.z - the z-component.public void setLocation(Vector3D vector)
vector - the other vector.
public static double magnitude(double x,
double y,
double z)
x - the X componenty - the Y componentz - the Z componentpublic double magnitude()
public Vector3D scale(double scale)
scale - the scale multiplier.
public static Vector3D diff(Vector3D vector1,
Vector3D vector2)
vector1 - the first vectorvector2 - the second vector
public static Vector3D diff(double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
x1 - the first location's X componenty1 - the first location's Y componentz1 - the first location's Z componentx2 - the second location's X componenty2 - the second location's Y componentz2 - the second location's Z component
public Vector3D diff(Vector3D vector)
vector - the other vector
public Vector3D diff(double x,
double y,
double z)
x - the vector's X componenty - the vector's Y componentz - the vector's Z component
public static Vector3D sum(Vector3D vector1,
Vector3D vector2)
vector1 - the first vectorvector2 - the second vector
public static Vector3D sum(double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
x1 - the first location's X componenty1 - the first location's Y componentz1 - the first location's Z componentx2 - the second location's X componenty2 - the second location's Y componentz2 - the second location's Z component
public Vector3D sum(Vector3D vector)
vector - the other vector
public Vector3D sum(double x,
double y,
double z)
x - the vector's X componenty - the vector's Y componentz - the vector's Z component
public static double dotProd(Vector3D vector1,
Vector3D vector2)
vector1 - the first vector.vector2 - the second vector.
public static double dotProd(double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
x1 - the first location's X componenty1 - the first location's Y componentz1 - the first location's Z componentx2 - the second location's X componenty2 - the second location's Y componentz2 - the second location's Z component
public double dotProd(Vector3D vector)
vector - the other vector.
public double dotProd(double x,
double y,
double z)
x - the X componenty - the Y componentz - the Z component
public static Vector3D crossProd(Vector3D vector1,
Vector3D vector2)
vector1 - the first vector.vector2 - the second vector.
public static Vector3D crossProd(double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
x1 - the first vector's X componenty1 - the first vector's Y componentz1 - the first vector's Z componentx2 - the second vector's X componenty2 - the second vector's Y componentz2 - the second vector's Z component
public Vector3D crossProd(Vector3D vector)
vector - the other vector.
public Vector3D crossProd(double x,
double y,
double z)
x - the X componenty - the Y componentz - the Z component
public boolean normalize()
public double distance(double x,
double y,
double z)
x - the X coordinatey - the Y coordinatez - the Z coordinatepublic double distance(Point3D point)
point - the other point.
public double distanceSQ(double x,
double y,
double z)
x - the X coordinatey - the Y coordinatez - the Z coordinatepublic double distanceSQ(Point3D point)
point - the other point.
public static double distanceSQ(double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
x1 - the first location's X coordinatey1 - the first location's Y coordinatez1 - the first location's Z coordinatex2 - the second location's X coordinatey2 - the second location's Y coordinatez2 - the second location's Z coordinatepublic java.lang.String toString()
toString in class java.lang.Objectpublic void Print()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||